-
-
Notifications
You must be signed in to change notification settings - Fork 483
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 parsing i18n.config.ts
with import { type I18nOptions }
#2017
Comments
The error thrown is caused by the way you're trying to import the import { type I18nOptions } from "@nuxtjs/i18n"; Should be import type { I18nOptions } from "@nuxtjs/i18n"; But if you want to use the export default defineI18nConfig((nuxt) => ({
legacy: false,
locale: 'en',
messages: {
en: {
welcome: 'Welcome',
},
de: {
welcome: 'Willkommen',
},
},
})); |
( |
Ah my bad, I had never seen that syntax before 😅, it's odd that it doesn't work. The other approach should work though, I changed your reproduction to use it here https://stackblitz.com/edit/github-smhrtw-lbpqxj?file=i18n.config.ts I'll look into updating the dependency causing this issue! Looks like |
I've fixed this issue. |
still an issue, see https://stackblitz.com/edit/github-smhrtw-nr8flw?file=package.json |
We need to define https://v8.i18n.nuxtjs.org/getting-started/basic-usage#translate-with-vue-i18n |
can you clarify how this has been fixed? e.g. https://stackblitz.com/edit/github-smhrtw-nr8flw?file=i18n.config.ts still breaks for me |
I still have this problem |
Currently, not support define style the below, const i18nConfg = (() => ){ ... });
…
export default i18nConfig; so ,you need to define it directly as export default, that is, export default defineI18nConfig(() => ({ ... })) |
should this issue be reopened then? |
I've just opened as new issue at #2094 |
Environment
Reproduction
https://stackblitz.com/edit/github-smhrtw
Describe the bug
the following
i18n.config.ts
produces an "unexpected token" error:error message:
Additional context
similarly,
satisfies I18nOptions
also breaks the config parsing (probably because thesucrase
fork used in this project has not seen an update in a while)Logs
No response
The text was updated successfully, but these errors were encountered: