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

Error when using i18n on Layer: [vite-node] [ERR_INVALID_ARG_VALUE] #2073

Closed
wypratama opened this issue May 13, 2023 · 8 comments
Closed

Error when using i18n on Layer: [vite-node] [ERR_INVALID_ARG_VALUE] #2073

wypratama opened this issue May 13, 2023 · 8 comments
Labels
bug 🐛 layers ❗ p4-important Priority 4: bugs that violate documented behavior, or significantly impact perf v8

Comments

@wypratama
Copy link

Environment

  • Operating System: Darwin
  • Node Version: v18.14.2
  • Nuxt Version: 3.4.3
  • Nitro Version: 2.4.0
  • Package Manager: pnpm@8.1.1
  • Builder: vite
  • User Config: typescript, modules, app, quasar, i18n
  • Runtime Modules: pinceau/nuxt, nuxt-quasar-ui@1.7.3, @nuxtjs/i18n@8.0.0-beta.12, nuxt-vitest
  • Build Modules: -

Reproduction

https://stackblitz.com/edit/node-2avl69?file=README.md

Describe the bug

Using Nuxt i18n in a layer project keep showing error below if I put i18n.config under root project. I can get it working only if I put i18n.config under .playground folder.

[vite-node] [ERR_INVALID_ARG_VALUE] @nuxtjs/packages/layer/i18n.config.ts&hash=069c89e7&from=./.nuxt/i18n.options.mjs

When layer is extended however, and I try to run the app that extend the layer, the error keeps showing no matter where I put the i18n.config file

Additional context

On reproduction if running pnpm run dev:layer, the project can run. But when we run pnpm run deb:web then I can't figure out how to make it running.

Logs

No response

@kazupon kazupon added bug 🐛 v8 🔨 p3-minor-bug Priority 3: a bug in an edge case that only affects very specific usage layers and removed pending triage labels May 15, 2023 — with Volta.net
@9M6
Copy link

9M6 commented Jun 8, 2023

Any update on this @kazupon ?

@dargmuesli dargmuesli added ❗ p4-important Priority 4: bugs that violate documented behavior, or significantly impact perf and removed 🔨 p3-minor-bug Priority 3: a bug in an edge case that only affects very specific usage labels Jun 19, 2023
@dargmuesli
Copy link
Collaborator

dargmuesli commented Jun 19, 2023

I've increased the priority as the issue violates documented behavior and is not only an edge case, I think.

@atayg
Copy link

atayg commented Jul 19, 2023

Hello, is there any update?
I guess I am getting same error related this issue. I try to implement i18n into the Nuxt Layer Template project.
Here are my details:

nuxt.config.ts:
export default defineNuxtConfig({ modules: ['@nuxtjs/i18n'], i18n: { vueI18n: './i18n.config.ts', },

i18n.config.ts:
export default defineI18nConfig(() => ({ lazy: true, langDir: 'locales', locales: [ { code: 'tr', iso: 'tr', name: 'Turkish(TR)', file: 'tr/tr.ts' }, { code: 'en', iso: 'en', name: 'English(EN)', file: 'en/en.ts' }, ], defaultLocale: 'tr', strategy: 'no_prefix', detectBrowserLanguage: false, legacy: false, fallbackLocale: 'tr', }));
Error:
[vite-node] [ERR_LOAD_URL] ..playground\i18n.config.ts?config=true

Thanks in advance.

@BobbieGoede
Copy link
Collaborator

This issue should be fixed by #2265, you can check it out by installing the edge channel @nuxtjs/i18n@npm:@nuxtjs/i18n-edge.

I have changed your reproduction to demonstrate this here: https://stackblitz.com/edit/node-yhgxzu?file=package.json
However in your reproduction, the layer config points to a i18n.config.ts which does not exist so I have commented that out. Can you confirm the edge channel resolves your issue locally?

@atayg
Copy link

atayg commented Jul 27, 2023

Hello Bobbie,

Thank you for your effort but still I could not use i18n for layer language support. Let me try to explain what I did.

  1. I try to add settings inside of nuxt.config and i18n file just in the layer (without playground). It does not work.
  2. I try to add settings inside of nuxt.config and i18n file for layer and playground project. It does not work.

In summary, I have app shell in the layer and I am giving some message to the layer but I could not control language support.

@BobbieGoede
Copy link
Collaborator

Hi @atayg,

It sounds like you may be experiencing a similar, but unrelated issue, can you open a separate issue and provide a reproduction of your setup?

@BobbieGoede
Copy link
Collaborator

I'm quite sure this issue is resolved in the edge channel so I will be closing this. @wypratama if you're still experiencing this issue with the edge channel installed, let me know and I'll reopen the issue again!

@dargmuesli
Copy link
Collaborator

I can confirm that this issue is resolved :)

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

No branches or pull requests

6 participants