Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webpack cannot resolve i18n.config and lazy translations #2115

Closed
YarikSWT opened this issue May 29, 2023 · 5 comments
Closed

Webpack cannot resolve i18n.config and lazy translations #2115

YarikSWT opened this issue May 29, 2023 · 5 comments
Labels
bug 🐛 bundler ❗ p4-important Priority 4: bugs that violate documented behavior, or significantly impact perf PR Welcome v8

Comments

@YarikSWT
Copy link

Environment

  • Operating System: Darwin
  • Node Version: v16.16.0
  • Nuxt Version: 3.5.1
  • Nitro Version: 2.4.1
  • Package Manager: npm@8.11.0
  • Builder: webpack
  • User Config: builder, modules, i18n
  • Runtime Modules: @nuxtjs/i18n@8.0.0-beta.12
  • Build Modules: -

Reproduction

https://stackblitz.com/edit/nuxt-starter-bk1a9i?file=nuxt.config.ts

Describe the bug

@nuxtjs/i18n module requires i18n.config file, when I use Vite as a builder everything works, but I need to use Webpack. When I tried to build nuxt3 project I got error caused by the inability to resolve the path to the required config file. Same problem I got when I trying to add lazy translations. Webpack cannot resolve them.

Additional context

No response

Logs

ERROR  in ./.nuxt/i18n.options.mjs                                                                                          

Module not found: Error: Package path ./__config__?target=../i18n.config.ts&hash=8468eb7d is not exported from package /home/projects/nuxt-starter-bk1a9i/node_modules/@nuxtjs/i18n (see exports field in /home/projects/nuxt-starter-bk1a9i/node_modules/@nuxtjs/i18n/package.json)
@ProEvv
Copy link

ProEvv commented May 29, 2023

I have same problem

@dargmuesli dargmuesli added bug 🐛 v8 PR Welcome bundler ❗ p4-important Priority 4: bugs that violate documented behavior, or significantly impact perf and removed pending triage labels May 29, 2023
@dargmuesli
Copy link
Collaborator

@kazupon I marked this as p4 because I think webpack is meant to be supported by this module. Feel free to correct that triage :)

@paidge
Copy link

paidge commented Jun 1, 2023

Lazy loading not working here. It works only for defaultLocale

@savyjs
Copy link

savyjs commented Jun 4, 2023

Lazy loading not working here. It works only for defaultLocale

...and does not work in the upper layer as well.

@BobbieGoede
Copy link
Collaborator

@YarikSWT this issue should be resolved by #2265, you can try it out by installing the edge channel. I've changed your reproduction to demonstrate this here.

I did run into a separate issue caused by vue-demi and found a workaround by adding build: { transpile: ['vue-demi'] } to the nuxt config.

I'll be closing this for now as it looks like the root issue has been fixed, please let me know if you're still experiencing this issue on the edge channel!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 bundler ❗ p4-important Priority 4: bugs that violate documented behavior, or significantly impact perf PR Welcome v8
Projects
None yet
Development

No branches or pull requests

6 participants