nuxt-modules / i18n

I18n module for Nuxt
https://i18n.nuxtjs.org
MIT License
1.7k stars 474 forks source link

[unhandledRejection] Declaration or statement expected - @nuxt/i18n + nuxt-typed-router #3091

Open danekslama opened 1 week ago

danekslama commented 1 week ago

Environment

Operating System: Windows 11

Packages: @esbuild/linux-x64@0.23.1 extraneous @nuxtjs/i18n@8.5.2 @parcel/watcher-linux-x64-glibc@2.4.1 extraneous @parcel/watcher-linux-x64-musl@2.4.1 extraneous @rollup/rollup-linux-x64-gnu@4.21.2 extraneous @rollup/rollup-linux-x64-musl@4.21.2 extraneous node-addon-api@7.1.1 extraneous nuxt-typed-router@3.6.5 nuxt@3.13.

Package Manager: npm

Reproduction

  1. Install nuxt-typed-router
  2. Install @nuxtjs/i18n
  3. Set strategy for @nuxtjs/i18n in nuxt.config.ts to 'prefix'
  4. Get [unhandledRejection] Declaration or statement expected during build

https://stackblitz.com/edit/bobbiegoede-nuxt-i18n-starter-qm6vpw?file=package.json,nuxt.config.ts,i18n.config.ts

Describe the bug

When both I18n and nuxt-typed-router are installed and strategy for I18n is set to "prefix", the nuxt-typed-router throws this exception:

[unhandledRejection] Declaration or statement expected. (128:8)

Additional context

No response

Logs

No response

BobbieGoede commented 1 week ago

You will probably have better luck opening an issue in the repository of nuxt-typed-router, I haven't looked into how it works but it may be relying on internal/undocumented logic to generate its types (just guessing).