Open skmd87 opened 5 months ago
Hi! Yeah there is a problem I spotted with the "prefix" strategy i'm sorry for this. I'll have to refactor a significant part of stuff on 4.0 and it's already in progress
looks promsing, is there any beta version yet?
Not yet it's not usable, i'll tell you when it's ready. But i'll surely will change how i18n types will work
I'm also running into the same error. Error is different but still traces to strategy: 'prefix'
and nuxt-typed-router
.
$ pnpm nuxi prepare
ERROR Declaration or statement expected. (158:8) 8:46:52 PM
156 | ? "index"
157 | : any : never
> 158 | : never;
| ^
159 |
160 |
161 |
156 | ? "index"
157 | : any : never
> 158 | : never;
| ^
159 |
160 |
161 |
What is the roadmap for this module when contrasted with Nuxt's experimental
integration of unplugin-vue-router
?
I second that question.
For people ending up here thinking they'd have to use this module to get typed routes, I have successfully started using the experimental.typedPages
option with i18n.
To me, that option seems to be the canonic approach, even if it's marked as experimental.
I second that question. For people ending up here thinking they'd have to use this module to get typed routes, I have successfully started using the
experimental.typedPages
option with i18n.To me, that option seems to be the canonic approach, even if it's marked as experimental.
How did you enable i18n tying with experimental.typedPages ??
Describe the bug Nuxt won't start when i18n is enabled. the following errors printed in console:
Expected behavior to run nuxt normally
Screenshots upon checking the generated .ts files, found those problems:
Environnement infos
Your
pages
folder structurepages
├── admin │ └── index.vue └── index.vue
Your nuxt.config.ts
modules: [ '@pinia/nuxt', ['@nuxtjs/eslint-module', eslintConfig], ['@nuxtjs/i18n', i18nConfig], '@formkit/auto-animate', '@vueuse/nuxt', ['@nuxt/image', imageConfig], ['nuxt-simple-sitemap', sitemapConfig], ['nuxt-jsonld', jsonldConfig], ['nuxt-simple-robots', robotsConfig], 'nuxt-typed-router', ['@vite-pwa/nuxt', pwaConfig], ],
//i18n config import { type ModuleOptions } from '@nuxtjs/i18n'
const config: ModuleOptions = { defaultLocale: 'en-US', langDir: 'config/i18n/locales/', locales: [ { code: 'en', iso: 'en-US', file: 'en-US.json', }, { code: 'ar', iso: 'ar-JO', file: 'ar-JO.json', }, ], lazy: true,
strategy: 'prefix' }
export default config