Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v10.0.1 throws error at build time (Vite/Nuxt) #1946

Closed
4 tasks done
Anton-Plagemann opened this issue Sep 13, 2024 · 9 comments
Closed
4 tasks done

v10.0.1 throws error at build time (Vite/Nuxt) #1946

Anton-Plagemann opened this issue Sep 13, 2024 · 9 comments
Labels
Status: Review Needed Request for review comments

Comments

@Anton-Plagemann
Copy link

Anton-Plagemann commented Sep 13, 2024

Reporting a bug?

Got a build error after upgrading to v10.

Expected behavior

Should build without errors

Reproduction

The error seems straighforward, if you need a reproduction let me know and I will try to create one.

System Info

System:
    OS: Linux 5.15 Debian GNU/Linux 11 (bullseye) 11 (bullseye)
    CPU: (20) x64 13th Gen Intel(R) Core(TM) i7-13800H
    Memory: 16.41 GB / 19.53 GB
    Container: Yes
    Shell: 5.1.4 - /bin/bash
  Binaries:
    Node: 22.8.0 - /usr/local/share/nvm/versions/node/v22.8.0/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.8.3 - /usr/local/share/nvm/versions/node/v22.8.0/bin/npm
    pnpm: 9.1.1 - /usr/local/share/npm-global/bin/pnpm
  Browsers:
    Chrome: 128.0.6613.119
  npmPackages:
    @intlify/unplugin-vue-i18n: ^5.0.0 => 5.0.0 
    @vue/eslint-config-prettier: ^9.0.0 => 9.0.0 
    vite-plugin-top-level-await: ^1.4.4 => 1.4.4 
    vue: ^3.5.4 => 3.5.4 
    vue-echarts: ^7.0.3 => 7.0.3 
    vue-i18n: ^10.0.1 => 10.0.1 
    vue-json-pretty: ^2.4.0 => 2.4.0 
    vue-router: ^4.4.3 => 4.4.4 
    vue-toast-notification: ^3.1.2 => 3.1.2 
    vue-tsc: ^2.1.6 => 2.1.6 
    vue3-apexcharts: ^1.6.0 => 1.6.0

Screenshot

image

Additional context

[log] Nuxt 3.13.1 with Nitro 2.9.7
[info] [nuxt:tailwindcss] Using Tailwind CSS from ~/assets/main.css
[info] Nuxt Icon server bundle mode is set to `local`
[info] Running with compatibility version `4`
[info] Building client...
[info] vite v5.4.3 building for production...
[info] transforming...
[info] ✓ 3307 modules transformed.
Error:  x Build failed in 28.18s
Error:  Nuxt Build Error: node_modules/vue-i18n/dist/vue-i18n.mjs (7:[9](https://github.com/Studicon-GmbH/studicon-ai/actions/runs/10842044385/job/30087033552?pr=2211#step:5:10)): "CORE_WARN_CODES_EXTEND_POINT" is not exported by "node_modules/@intlify/core-base/dist/core-base.mjs", imported by "node_modules/vue-i18n/dist/vue-i18n.mjs".
file: /home/runner/work/studicon-ai/studicon-ai/node_modules/vue-i18n/dist/vue-i18n.mjs:7:9

5:   */
6: import { getGlobalThis, format, makeSymbol, isObject, isPlainObject, isArray, deepCopy, isString, hasOwn, warn, isBoo...
7: import { CORE_WARN_CODES_EXTEND_POINT, CORE_ERROR_CODES_EXTEND_POINT, createCompileError, DEFAULT_LOCALE, updateFallb...
            ^
8: import { createVNode, Text, computed, watch, getCurrentInstance, ref, shallowRef, Fragment, defineComponent, h, effec...
9: import { setupDevtoolsPlugin } from '@vue/devtools-api';

  file: node_modules/vue-i18n/dist/vue-i18n.mjs:7:9
  
  5:   */
  6: import { getGlobalThis, format, makeSymbol, isObject, isPlainObject, isArray, deepCopy, isString, hasOwn, warn, isBoo...
  7: import { CORE_WARN_CODES_EXTEND_POINT, CORE_ERROR_CODES_EXTEND_POINT, createCompileError, DEFAULT_LOCALE, updateFallb...
  ^
  8: import { createVNode, Text, computed, watch, getCurrentInstance, ref, shallowRef, Fragment, defineComponent, h, effec...
  9: import { setupDevtoolsPlugin } from '@vue/devtools-api';
  
  at getRollupError (node_modules/rollup/dist/es/shared/parseAst.js:392:41)
  at error (node_modules/rollup/dist/es/shared/parseAst.js:388:42)
  at Module.error (node_modules/rollup/dist/es/shared/node-entry.js:13967:16)
  at Module.traceVariable (node_modules/rollup/dist/es/shared/node-entry.js:14414:29)
  at ModuleScope.findVariable (node_modules/rollup/dist/es/shared/node-entry.js:[12](https://github.com/Studicon-GmbH/studicon-ai/actions/runs/10842044385/job/30087033552?pr=2211#step:5:13)121:39)
  at Identifier.bind (node_modules/rollup/dist/es/shared/node-entry.js:6941:40)
  at Property.bind (node_modules/rollup/dist/es/shared/node-entry.js:4808:23)
  at ObjectExpression.bind (node_modules/rollup/dist/es/shared/node-entry.js:4804:28)
  at VariableDeclarator.bind (node_modules/rollup/dist/es/shared/node-entry.js:4808:23)
  at VariableDeclaration.bind (node_modules/rollup/dist/es/shared/node-entry.js:4804:28)
Error: Process completed with exit code 1.

Validations

@Anton-Plagemann Anton-Plagemann added the Status: Review Needed Request for review comments label Sep 13, 2024
@Anton-Plagemann Anton-Plagemann changed the title v10 throws error at build time (Vite/Nuxt) v10.0.1 throws error at build time (Vite/Nuxt) Sep 13, 2024
@BobbieGoede
Copy link
Member

Can you check what version @intlify/core-base is installed? It sounds like you have an older version installed and refreshing lockfiles and reinstalling dependencies might resolve this issue.

If that doesn't resolve it, a minimal reproduction would be very helpful in debugging this further 🙏

@Anton-Plagemann
Copy link
Author

Anton-Plagemann commented Sep 13, 2024

Deleting the lockfile and reinstalling packages did not solve it, but changed the error message to a different one:

 ERROR  x Build failed in 13.90s                                                                                                                                      7:07:05 AM


[7:07:05 AM]  ERROR  Nuxt Build Error: node_modules/@intlify/core-base/dist/core-base.mjs (7:9): "CompileWarnCodes" is not exported by "node_modules/@intlify/message-compiler/dist/message-compiler.mjs", imported by "node_modules/@intlify/core-base/dist/core-base.mjs".
file: /app/node_modules/@intlify/core-base/dist/core-base.mjs:7:9

5:   */
6: import { getGlobalThis, isObject, isFunction, isString, isNumber, isPlainObject, assign, join, toDisplayString, isArr...
7: import { CompileWarnCodes, CompileErrorCodes, createCompileError, detectHtmlTag, defaultOnError, baseCompile as baseC...
            ^
8: export { CompileErrorCodes, createCompileError } from '@intlify/message-compiler';


  file: node_modules/@intlify/core-base/dist/core-base.mjs:7:9
  
  5:   */
  6: import { getGlobalThis, isObject, isFunction, isString, isNumber, isPlainObject, assign, join, toDisplayString, isArr...
  7: import { CompileWarnCodes, CompileErrorCodes, createCompileError, detectHtmlTag, defaultOnError, baseCompile as baseC...
  ^
  8: export { CompileErrorCodes, createCompileError } from '@intlify/message-compiler';
  
  at getRollupError (node_modules/rollup/dist/es/shared/parseAst.js:392:41)
  at error (node_modules/rollup/dist/es/shared/parseAst.js:388:42)
  at Module.error (node_modules/rollup/dist/es/shared/node-entry.js:13968:16)
  at Module.traceVariable (node_modules/rollup/dist/es/shared/node-entry.js:14415:29)
  at ModuleScope.findVariable (node_modules/rollup/dist/es/shared/node-entry.js:12122:39)
  at MemberExpression.bind (node_modules/rollup/dist/es/shared/node-entry.js:8843:49)
  at VariableDeclarator.bind (node_modules/rollup/dist/es/shared/node-entry.js:4808:23)
  at VariableDeclaration.bind (node_modules/rollup/dist/es/shared/node-entry.js:4804:28)
  at Program.bind (node_modules/rollup/dist/es/shared/node-entry.js:4804:28)
  at Module.bindReferences (node_modules/rollup/dist/es/shared/node-entry.js:13947:18)

I will try to create a reproduction later 👍

@intlify/core-base version (same before reinstall and after):

node ➜ /app (feature/o1) $ npm list @intlify/core-base
[email protected] /app
├─┬ @intlify/[email protected]
│ └─┬ @intlify/[email protected]
│   └─┬ [email protected]
│     └── @intlify/[email protected] deduped
├─┬ @nuxtjs/[email protected]
│ ├─┬ @intlify/[email protected]
│ │ └─┬ @intlify/[email protected]
│ │   └── @intlify/[email protected] deduped
│ └─┬ [email protected]
│   └── @intlify/[email protected]
└─┬ [email protected]
  └── @intlify/[email protected]

@Anton-Plagemann
Copy link
Author

Anton-Plagemann commented Sep 13, 2024

Ok, after adding

  "overrides": {
    "@intlify/core-base": "^10.0.1"
  }

to my package.json, resulting in

node ➜ /app (feature/o1) $ npm list @intlify/core-base
[email protected] /app
├─┬ @intlify/[email protected]
│ └─┬ @intlify/[email protected]
│   └─┬ [email protected]
│     └── @intlify/[email protected] deduped
├─┬ @nuxtjs/[email protected]
│ ├─┬ @intlify/[email protected]
│ │ └─┬ @intlify/[email protected]
│ │   └── @intlify/[email protected] deduped
│ └─┬ [email protected]
│   └── @intlify/[email protected] deduped
└─┬ [email protected]
  └── @intlify/[email protected] overridden

I get a third, also different error message 😄

 ERROR  x Build failed in 13.62s                                                                                                                                      7:12:36 AM


[7:12:36 AM]  ERROR  Nuxt Build Error: node_modules/@nuxtjs/i18n/node_modules/vue-i18n/dist/vue-i18n.mjs (6:24): "incrementer" is not exported by "node_modules/@intlify/shared/dist/shared.mjs", imported by "node_modules/@nuxtjs/i18n/node_modules/vue-i18n/dist/vue-i18n.mjs".
file: /app/node_modules/@nuxtjs/i18n/node_modules/vue-i18n/dist/vue-i18n.mjs:6:24

4:   * Released under the MIT License.
5:   */
6: import { getGlobalThis, incrementer, format, makeSymbol, isPlainObject, isArray, deepCopy, isString, hasOwn, isObject...
                           ^
7: import { CoreWarnCodes, CoreErrorCodes, createCompileError, DEFAULT_LOCALE, updateFallbackLocale, setFallbackContext,...
8: import { createVNode, Text, computed, watch, getCurrentInstance, ref, shallowRef, Fragment, defineComponent, h, effec...


  file: node_modules/@nuxtjs/i18n/node_modules/vue-i18n/dist/vue-i18n.mjs:6:24
  
  4:   * Released under the MIT License.
  5:   */
  6: import { getGlobalThis, incrementer, format, makeSymbol, isPlainObject, isArray, deepCopy, isString, hasOwn, isObject...
  ^
  7: import { CoreWarnCodes, CoreErrorCodes, createCompileError, DEFAULT_LOCALE, updateFallbackLocale, setFallbackContext,...
  8: import { createVNode, Text, computed, watch, getCurrentInstance, ref, shallowRef, Fragment, defineComponent, h, effec...
  
  at getRollupError (node_modules/rollup/dist/es/shared/parseAst.js:392:41)
  at error (node_modules/rollup/dist/es/shared/parseAst.js:388:42)
  at Module.error (node_modules/rollup/dist/es/shared/node-entry.js:13968:16)
  at Module.traceVariable (node_modules/rollup/dist/es/shared/node-entry.js:14415:29)
  at ModuleScope.findVariable (node_modules/rollup/dist/es/shared/node-entry.js:12122:39)
  at Identifier.bind (node_modules/rollup/dist/es/shared/node-entry.js:6941:40)
  at CallExpression.bind (node_modules/rollup/dist/es/shared/node-entry.js:4808:23)
  at CallExpression.bind (node_modules/rollup/dist/es/shared/node-entry.js:9224:15)
  at VariableDeclarator.bind (node_modules/rollup/dist/es/shared/node-entry.js:4808:23)
  at VariableDeclaration.bind (node_modules/rollup/dist/es/shared/node-entry.js:4804:28)

@Anton-Plagemann
Copy link
Author

Anton-Plagemann commented Sep 13, 2024

Ok, solved it.
After adding

"overrides": {
    "vue-i18n": "^10.0.1"
  }

to the package.json-file everything works again.

The issue seems to be in the @nuxtjs/i18n package. I will open an issue there. Thanks for your support! 🙏

node ➜ /app (feature/o1) $ npm list vue-i18n
[email protected] /app
├─┬ @intlify/[email protected]
│ ├─┬ @intlify/[email protected]
│ │ └── [email protected]
│ └── [email protected] deduped
├─┬ @nuxtjs/[email protected]
│ ├─┬ @intlify/[email protected]
│ │ └── [email protected] deduped
│ └── [email protected]
└── [email protected]

@BobbieGoede
Copy link
Member

Oh I see you're using @nuxtjs/i18n v8 which does not support vue-i18n v10, we're working on @nuxtjs/i18n v9 which among other changes supports vue-i18n v10. Check out nuxt-modules/i18n#3002 for its progress.

@Anton-Plagemann
Copy link
Author

Ah nice, thanks! Then I will wait for @nuxtjs/i18n v9 to be released 🙌 Thanks again!

@DamageESP
Copy link
Contributor

I'm also getting this. Unfortunately, the fix proposed by @Anton-Plagemann didn't work.

 ERROR  x Build failed in 3.54s                                                         9:51:49 PM


[9:51:49 PM]  ERROR  Nuxt Build Error: ../../../node_modules/@intlify/core-base/dist/core-base.mjs (6:121): "incrementer" is not exported by "../../../node_modules/@intlify/shared/dist/shared.mjs", imported by "../../../node_modules/@intlify/core-base/dist/core-base.mjs".
file: /home/damageesp/myapp/node_modules/@intlify/core-base/dist/core-base.mjs:6:121

4:   * Released under the MIT License.
5:   */
6: import { getGlobalThis, isObject, isFunction, isString, isNumber, isPlainObject, assign, join, toDisplayString, isArray, incremente...
                                                                                                                            ^
7: import { CompileWarnCodes, CompileErrorCodes, createCompileError, detectHtmlTag, defaultOnError, baseCompile as baseCompile$1 } fro...
8: export { CompileErrorCodes, createCompileError } from '@intlify/message-compiler';


  file: /home/damageesp/myapp/node_modules/@intlify/core-base/dist/core-base.mjs:6:121
  
  4:   * Released under the MIT License.
  5:   */
  6: import { getGlobalThis, isObject, isFunction, isString, isNumber, isPlainObject, assign, join, toDisplayString, isArray, incremente...
  ^
  7: import { CompileWarnCodes, CompileErrorCodes, createCompileError, detectHtmlTag, defaultOnError, baseCompile as baseCompile$1 } fro...
  8: export { CompileErrorCodes, createCompileError } from '@intlify/message-compiler';
  
  at getRollupError (/home/damageesp/myapp/node_modules/rollup/dist/es/shared/parseAst.js:392:41)
  at error (/home/damageesp/myapp/node_modules/rollup/dist/es/shared/parseAst.js:388:42)
  at Module.error (/home/damageesp/myapp/node_modules/rollup/dist/es/shared/node-entry.js:13968:16)
  at Module.traceVariable (/home/damageesp/myapp/node_modules/rollup/dist/es/shared/node-entry.js:14415:29)
  at ModuleScope.findVariable (/home/damageesp/myapp/node_modules/rollup/dist/es/shared/node-entry.js:12122:39)
  at Identifier.bind (/home/damageesp/myapp/node_modules/rollup/dist/es/shared/node-entry.js:6941:40)
  at CallExpression.bind (/home/damageesp/myapp/node_modules/rollup/dist/es/shared/node-entry.js:4808:23)
  at CallExpression.bind (/home/damageesp/myapp/node_modules/rollup/dist/es/shared/node-entry.js:9224:15)
  at VariableDeclarator.bind (/home/damageesp/myapp/node_modules/rollup/dist/es/shared/node-entry.js:4808:23)
  at VariableDeclaration.bind (/home/damageesp/myapp/node_modules/rollup/dist/es/shared/node-entry.js:4804:28)

npm error Lifecycle script `build` failed with error:
npm error code 1
npm error path /home/damageesp/myapp/packages/apps/matcher
npm error workspace [email protected]
npm error location /home/damageesp/myapp/packages/apps/matcher
npm error command failed
npm error command sh -c nuxt build

FWIW the issue started when moving to a monorepo structure with Lerna, although I don't think it's related.

@Anton-Plagemann
Copy link
Author

Anton-Plagemann commented Sep 18, 2024

Hi @DamageESP,
I had the same issue again, this time caused by the @intlify/unplugin-vue-i18n package.
After downgrading it from 5.0.0 to 4.0.0 it worked again, so maybe that could help you too 😊

{
  "dependencies": {
    "vue-i18n": "^9.14.0"
  },
  "devDependencies": {
    "@intlify/unplugin-vue-i18n": "^4.0.0"
  }
}

@DamageESP
Copy link
Contributor

DamageESP commented Sep 18, 2024

Thanks for the suggestion @Anton-Plagemann, but the solution was different (and simpler).

As @BobbieGoede very well pointed out, @nuxtjs/i18n does not yet support the latest versions of vue-i18n. So I had to simply change the version from next (which points to version 10.0.1 of the breaking module @intlify/shared) to ^8.0.0 (which uses the older 9.9.0 version):

- "@nuxtjs/i18n": "next",
+ "@nuxtjs/i18n": "^8.0.0",

This resolved all my problems, of course after running a clean install (deleted package-lock.json as well as the node_modules folder)

I hope this helps clean up your package.json a bit, as well as others!

Note: It's interesting though that we have a broken version of the library in main, I'm surprised there isn't a lot more noise about this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Review Needed Request for review comments
Projects
None yet
Development

No branches or pull requests

3 participants