Closed AnoRebel closed 7 months ago
Trying to setup a clean nuxt app with translations, using @nuxtjs/i18n and @intlify/unplugin-vue-i18n but the app fails with the error below:
@nuxtjs/i18n
@intlify/unplugin-vue-i18n
@nuxtjs/i18n Failed locale loading: [vite-node] [plugin:unplugin-vue-i18n] [VITE_ERROR] /locales/en.json <br><pre>const resource = { "title": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["Portfolio"])};fn.source="Portfolio";return fn;})() } export default resource</pre><br> ERROR Internal server error: Unexpected token 'const'. 3:08:59 PM Plugin: unplugin-vue-i18n
No errors and translations to work normally.
https://stackblitz.com/edit/nuxt-starter-jpctmx?file=package.json,i18n.config.ts,nuxt.config.ts
unplugin-vue-i18n
System: OS: Linux 5.0 undefined CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz Memory: 0 Bytes / 0 Bytes Shell: 1.0 - /bin/jsh Binaries: Node: 18.18.0 - /usr/local/bin/node Yarn: 1.22.19 - /usr/local/bin/yarn npm: 9.4.2 - /usr/local/bin/npm pnpm: 8.10.5 - /usr/local/bin/pnpm
No response
I'll close this issue due to the help I got.
Reporting a bug?
Trying to setup a clean nuxt app with translations, using
@nuxtjs/i18n
and@intlify/unplugin-vue-i18n
but the app fails with the error below:Expected behavior
No errors and translations to work normally.
Reproduction
https://stackblitz.com/edit/nuxt-starter-jpctmx?file=package.json,i18n.config.ts,nuxt.config.ts
Issue Package
unplugin-vue-i18n
System Info
Screenshot
Additional context
No response
Validations