intlify / bundle-tools

bundling for intlify i18n tools
MIT License
232 stars 37 forks source link

@intlify/unplugin-vue-i18n doesn't work with Nuxt 3.7 #292

Closed mcrapts closed 10 months ago

mcrapts commented 10 months ago

Reporting a bug?

After upgrading to Nuxt 3.7, vue-i18n doesn't work anymore when building the app. It works in development mode, but running npm run build && node .output/server/index.mjs results in the following error:

[500] Cannot find module '/home/projects/github-hnz7et/.output/server/chunks/dist/vue-i18n.runtime.mjs' imported from /home/projects/github-hnz7et/.output/server/chunks/app/server.mjs

I am not sure whether this is an issue with vue-i18n, @intlify/unplugin-vue-i18n or Nuxt, but my first hunch is there is something wrong in the plugin.

Expected behavior

Building and running an app with Nuxt 3.7 where vue-i18n is setup according to the instructions should work without errors.

Reproduction

  1. Go to: https://stackblitz.com/edit/github-hnz7et-dysose?file=package.json
  2. Run npm run build && node .output/server/index.mjs
  3. Verify that it results in error 500 when accessing the app through the web browser

Issue Package

unplugin-vue-i18n

System Info

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: 16.20.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 9.4.2 - /usr/local/bin/npm
    pnpm: 8.6.10 - /usr/local/bin/pnpm
  npmPackages:
    vue-i18n: ^9.3.0 => 9.3.0

Screenshot

image image

Additional context

No response

Validations

mcrapts commented 10 months ago

This is an issue with vue-i18n, possibly only the docs need to be updated. See: https://github.com/intlify/vue-i18n-next/issues/1546

This issue can be closed.