intlify/vue-i18n

examples/frameworks/nuxt3 not working

xss opened this issue · 0 comments

xss commented

Reporting a bug?

As I couldn't figure out how to use unplugin-vue-i18n in combination with nuxtjs following this integration guide, I tried reproducing everything from the examples. However, this example seems to be broken and therefore little helpful.

Expected behavior

The minimal demo app should run just fine.

Reproduction

  • Clone this repo (no matter whether whole repo or only the examples/frameworks/nuxt3 subdir via GIT sparseCheckout).
  • Change into the subdir examples/frameworks/nuxt3, and follow the README in that subdir:
    • npm install
    • npm run dev

This throws the following error, and no server will be started:

$ npm run dev

> dev
> nuxt dev

Nuxt 3.7.4 with Nitro 2.6.3                                                                                               1:42:59 PM

 ERROR  (0 , _nuxt.defineNuxtConfig) is not a function                                                                    1:43:00 PM

  at nuxt.config.ts:7:43
  at evalModule (node_modules/jiti/dist/jiti.js:1:255614)
  at Object.jiti (node_modules/jiti/dist/jiti.js:1:253542)
  at resolveConfig (node_modules/c12/dist/index.mjs:280:24)
  at loadConfig (node_modules/c12/dist/index.mjs:116:40)
  at async loadNuxtConfig (node_modules/@nuxt/kit/dist/index.mjs:2530:18)
  at async Object.run (node_modules/nuxi/dist/chunks/dev.mjs:174:25)
  at async runCommand$1 (node_modules/nuxi/dist/shared/nuxi.9d864d83.mjs:1647:7)
  at async runCommand$1 (node_modules/nuxi/dist/shared/nuxi.9d864d83.mjs:1638:11)
  at async runMain$1 (node_modules/nuxi/dist/shared/nuxi.9d864d83.mjs:1770:7) 



 ERROR  (0 , _nuxt.defineNuxtConfig) is not a function                                                                    1:43:00 PM

There also seem to be issues in nuxt.config.ts:

  • In line 1, defineNuxtConfig is highlighted with this error in my IDE: 'TS2305: Module "nuxt" has no exported member defineNuxtConfig'
  • In line 20, the import.meta portion of import.meta.url is highlighted with this error: 'TS1343: The import.meta meta-property is only allowed when the --module option is es2020, es2022, esnext, system, node16, or nodenext'

System Info

System:
    OS: Linux 5.14 Ubuntu 22.04.3 LTS 22.04.3 LTS (Jammy Jellyfish)
    CPU: (12) x64 Intel(R) Core(TM) i7-10850H CPU @ 2.70GHz
    Memory: 17.27 GB / 30.97 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 19.3.0 - ~/node_modules/.bin/node
    npm: 9.9.0 - ~/node_modules/.bin/npm
  Browsers:
    Brave Browser: 120.1.61.101
  npmPackages:
    @intlify/unplugin-vue-i18n: ^1.0.1 => 1.4.0 
    vue-i18n: ^9.3.0 => 9.5.0

Screenshot

No response

Additional context

No response

Validations