[ERR_MODULE_NOT_FOUND] /@vite/dynamic-import-helper
See original GitHub issueEnvironment
- Operating System:
Windows_NT
- Node Version:
v16.13.2
- Nuxt Version:
3.0.0-rc.11
- Nitro Version:
0.5.4
- Package Manager:
npm@8.13.2
- Builder:
vite
- User Config:
-
- Runtime Modules:
-
- Build Modules:
-
Reproduction
Doesnt happen on stackblitz, so may be windows related
https://github.com/warflash/nuxt3_7794
Describe the bug
Adding a dynamic vite import like this:
const messages = await import(`./locales/${newLocale}.json`);
in rc10 or 11 throws the following error
[vite-node] [ERR_MODULE_NOT_FOUND] /@vite/dynamic-import-helper
Additional context
Sorry if this is a dupe of https://github.com/nuxt/framework/issues/7729, the error seemed different tho so I figured I’d open an issue to be save
Logs
500
[vite-node] [ERR_MODULE_NOT_FOUND] /@vite/dynamic-import-helper
at /@vite/dynamic-import-helper
Issue Analytics
- State:
- Created a year ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Features | Vite
Rewrite the imports to valid URLs like /node_modules/.vite/deps/my-dep.js?v=f3sf2ebd so that the browser can import them properly. Dependencies are Strongly ...
Read more >Vue + Vite + Rollup: Dynamic import not working on ...
I was recently doing a PoC and was surprised to know that dynamic imports feature works fine in dev mode but fails in...
Read more >vite failed to fetch dynamically imported module - You.com
One attempt to fix this issue, try to catch the error and force a reload to refetch the resource, but make sure to...
Read more >rollup.js
Run rollup --help to see the available options and parameters. ... Dynamic Import. Import modules using the dynamic import API. import('.
Read more >Dynamic import() - vite-plugin-ssr
Client-side only components: we can use import() to avoid loading/rendering a component on the server-side. (Some component libraries cannot be server-side ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For now, you can work around this issue with:
Removing the extension fixed it:
defineAsyncComponent(() => import(
./svgs/${props.icon}.vue)
=>defineAsyncComponent(() => import(
./svgs/${props.icon})