Closed Anton-Plagemann closed 2 months ago
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 🙏
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
app@10.29.0 /app
├─┬ @intlify/unplugin-vue-i18n@5.0.0
│ └─┬ @intlify/vue-i18n-extensions@6.2.0
│ └─┬ vue-i18n@9.14.0
│ └── @intlify/core-base@9.14.0 deduped
├─┬ @nuxtjs/i18n@8.5.3
│ ├─┬ @intlify/h3@0.5.0
│ │ └─┬ @intlify/core@9.14.0
│ │ └── @intlify/core-base@9.14.0 deduped
│ └─┬ vue-i18n@9.14.0
│ └── @intlify/core-base@9.14.0
└─┬ vue-i18n@10.0.1
└── @intlify/core-base@10.0.1
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
app@10.29.0 /app
├─┬ @intlify/unplugin-vue-i18n@5.0.0
│ └─┬ @intlify/vue-i18n-extensions@6.2.0
│ └─┬ vue-i18n@9.14.0
│ └── @intlify/core-base@10.0.1 deduped
├─┬ @nuxtjs/i18n@8.5.3
│ ├─┬ @intlify/h3@0.5.0
│ │ └─┬ @intlify/core@9.14.0
│ │ └── @intlify/core-base@10.0.1 deduped
│ └─┬ vue-i18n@9.14.0
│ └── @intlify/core-base@10.0.1 deduped
└─┬ vue-i18n@10.0.1
└── @intlify/core-base@10.0.1 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)
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
app@10.29.0 /app
├─┬ @intlify/unplugin-vue-i18n@5.0.0
│ ├─┬ @intlify/vue-i18n-extensions@6.2.0
│ │ └── vue-i18n@9.14.0
│ └── vue-i18n@10.0.1 deduped
├─┬ @nuxtjs/i18n@8.5.3
│ ├─┬ @intlify/unplugin-vue-i18n@3.0.1
│ │ └── vue-i18n@9.14.0 deduped
│ └── vue-i18n@9.14.0
└── vue-i18n@10.0.1
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 https://github.com/nuxt-modules/i18n/issues/3002 for its progress.
Ah nice, thanks! Then I will wait for @nuxtjs/i18n
v9 to be released 🙌 Thanks again!
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 myapp@1.0.0
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.
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"
}
}
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.
Downgrading to an older version of @nuxtjs/i18n
is not an option for us (using ^9.0.0-alpha.1
). Thefore I had to lock @intlify/shared
to a version that did not have any issues (9.9.0
), this however introduced the following error:
Uncaught SyntaxError: The requested module 'http://localhost:3000/_nuxt/@fs/Users/xxx/Development/xxx/node_modules/.cache/vite/client/deps/@intlify_core-base.js?v=63061a40' doesn't provide an export named: 'CORE_ERROR_CODES_EXTEND_POINT'
Perhaps related to the fact that @nuxtjs/i18n
does not yet support the latest versions of vue-i18n
@DamageESP ?
@StijnCoolen That's very likely caused by a mismatch of versions, for clarity:
@nuxtjs/i18n
v8 depends on vue-i18n
v9@nuxtjs/i18n
v9 depends on vue-i18n
v10You should not use any other combination.
If you're using @nuxtjs/i18n
I think you should be able to fully rely on it installing the correct dependencies (removing vue-i18n
and its dependencies from your package file). Though I have ran into projects that needed these dependencies explicitly added YMMV.
If you are using compatible versions, make sure these are up to date and refresh/remove your lock files to force the installation of correct sub-dependencies (these errors seem to hint at this being the issue).
@BobbieGoede thanks for thinking with me! Installing only "@nuxtjs/i18n": "^9.0.0-alpha.3"
and removing the override that I had in place (vue-i18n
) and the lockfile results in the following error:
Error: Build failed with 1 error: node_modules/@intlify/core-base/dist/core-base.mjs:6:121: ERROR: No matching export in "node_modules/@intlify/shared/dist/shared.mjs" for import "incrementer"
That's odd, can you try doing the same but installing the latest nightly release channel instead ("@nuxtjs/i18n": "npm:@nuxtjs/i18n-edge@9.0.0-alpha.3-28788324.b9e5296"
)? If that still doesn't work can you try creating a minimal reproduction of this issue? 🙏
I fixed the CORE_ERROR_CODES_EXTEND_POINT
errors in @nuxtjs/i18n (9.0.0-rc.2) with:
"overrides": {
"vue-i18n": "latest",
"@intlify/core-base": "latest",
"@intlify/message-compiler": "latest"
}
All 3 were required to stop the error from appearing at build time or runtime
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
Screenshot
Additional context
Validations