question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[ERR_MODULE_NOT_FOUND] /@vite/dynamic-import-helper

See original GitHub issue

Environment


  • 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

Stackblitz

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:open
  • Created a year ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
danielroecommented, Sep 30, 2022

For now, you can work around this issue with:

// https://v3.nuxtjs.org/api/configuration/nuxt.config
export default defineNuxtConfig({
  vite: {
    devBundler: 'legacy'
  }
})
1reaction
parsagholipourcommented, Nov 21, 2022

Removing the extension fixed it: defineAsyncComponent(() => import(./svgs/${props.icon}.vue) => defineAsyncComponent(() => import(./svgs/${props.icon})

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found