You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Node/Vercel (seems to be unrelated to a specific one)
What package manager are you using?
npm
What operating system are you using?
Linux
Describe the Bug
When using Vite's import aliases, the application runs without problems in dev mode. However, when building the application for production and the application will generate client-side JS, a compilation problem occurs within Rollup:
> @example/[email protected] build
> astro build
18:10:14 [build] output target: server
18:10:14 [build] deploy adapter: @astrojs/vercel/serverless
18:10:14 [build] Collecting build info...
18:10:14 [build] Completed in 21ms.
18:10:14 [build] Building server entrypoints...
18:10:16 [build] Completed in 1.89s.
building client
Could not resolve entry module (@/components/Button.vue).
transforming (8) node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js error Could not resolve entry module (@/components/Button.vue).
File:
/home/developer/dev/astro-alias-srcDir/node_modules/rollup/dist/es/shared/rollup.js:1858:30
Code:
1857 | if (!(base instanceof Error))
> 1858 | base = Object.assign(new Error(base.message), base);
| ^
1859 | throw base;
1860 | }
1861 | function augmentCodeLocation(props, pos, source, id) {
Stacktrace:
Error: Could not resolve entry module (@/components/Button.vue).
at error (file:///home/developer/dev/astro-alias-srcDir/node_modules/rollup/dist/es/shared/rollup.js:1858:30)
at ModuleLoader.loadEntryModule (file:///home/developer/dev/astro-alias-srcDir/node_modules/rollup/dist/es/shared/rollup.js:22175:20)
at async Promise.all (index 0)
I am willing to submit a pull request for this issue.
The text was updated successfully, but these errors were encountered:
luiz
changed the title
Client-side assets build fails when using import aliases + Astro srcDir
Client-side assets build fails when using import aliases
Jan 11, 2023
This looks similar to #3199 and caused by rollup/plugins#1190. I'll send fix to Rollup and probably manually resolve our entries for now to temporarily workaround it.
For your project, you can also add "baseUrl": "." in the tsconfig.json to workaround it.
What version of
astro
are you using?1.9.1
Are you using an SSR adapter? If so, which one?
Node/Vercel (seems to be unrelated to a specific one)
What package manager are you using?
npm
What operating system are you using?
Linux
Describe the Bug
When using Vite's import aliases, the application runs without problems in dev mode. However, when building the application for production and the application will generate client-side JS, a compilation problem occurs within Rollup:
Link to Minimal Reproducible Example
https://github.com/luiz/astro-alias-srcDir
Participation
The text was updated successfully, but these errors were encountered: