Error when using `vue-i18n` after upgrading to `v3.0.0-rc.7`: The requested module 'unenv/runtime/mock/proxy-cjs' is a CommonJS module
See original GitHub issueEnvironment
- Operating System:
Darwin
- Node Version:
v16.16.0
- Nuxt Version:
3.0.0-rc.7
- Package Manager:
yarn@1.22.19
- Builder:
vite
- User Config:
typescript
,vite
- Runtime Modules:
-
- Build Modules:
-
Reproduction
https://stackblitz.com/edit/github-9pcvmt
Describe the bug
When I run yarn build
and then to check out the result, I get the error shown below. This happens both locally with yarn preview
and when I deploy to Vercel. I have tried it both with v3.0.0-rc.7` and the edge channel.
[nuxt] [request error] [unhandled] [500] Named export 'setupDevtoolsPlugin' not found. The requested module 'unenv/runtime/mock/proxy-cjs' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
import pkg from 'unenv/runtime/mock/proxy-cjs';
const { setupDevtoolsPlugin } = pkg;
at ModuleJob._instantiate (node:internal/modules/esm/module_job:128:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:194:5)
at async Promise.all (index 0)
at async ESMLoader.import (node:internal/modules/esm/loader:385:24)
at async ./server/chunks/handlers/renderer.mjs:11089:24
at async ./server/chunks/handlers/renderer.mjs:11143:64
at async ./server/chunks/handlers/renderer.mjs:14:22
at async ./server/node_modules/h3/dist/index.mjs:492:19
at async Server.nodeHandler (./server/node_modules/h3/dist/index.mjs:438:7)
Additional context
No response
Logs
<--- Last few GCs --->
[8655:0x130008000] 49499 ms: Mark-sweep (reduce) 4114.6 (4123.9) -> 4094.8 (4104.3) MB, 4.0 / 0.0 ms (+ 0.0 ms in 0 steps since start of marking, biggest step 0.0 ms, walltime since start of marking 79 ms) (average mu = 0.899, current mu = 0.951) allo[8655:0x130008000] 49551 ms: Mark-sweep (reduce) 4114.4 (4123.9) -> 4114.3 (4123.9) MB, 0.9 / 0.0 ms (+ 0.8 ms in 1 steps since start of marking, biggest step 0.8 ms, walltime since start of marking 50 ms) (average mu = 0.935, current mu = 0.968) allo
<--- JS stacktrace --->
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
1: 0x10443c6e8 node::Abort() [/Users/sander/.nvm/versions/node/v16.16.0/bin/node]
2: 0x10443c870 node::errors::TryCatchScope::~TryCatchScope() [/Users/sander/.nvm/versions/node/v16.16.0/bin/node]
3: 0x10458c000 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/Users/sander/.nvm/versions/node/v16.16.0/bin/node]
4: 0x10458bf94 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/Users/sander/.nvm/versions/node/v16.16.0/bin/node]
5: 0x10470f6ac v8::internal::Heap::GarbageCollectionReasonToString(v8::internal::GarbageCollectionReason) [/Users/sander/.nvm/versions/node/v16.16.0/bin/node]
6: 0x10470e1cc v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/Users/sander/.nvm/versions/node/v16.16.0/bin/node]
7: 0x104719514 v8::internal::Heap::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/Users/sander/.nvm/versions/node/v16.16.0/bin/node]
8: 0x1047195a8 v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/Users/sander/.nvm/versions/node/v16.16.0/bin/node]
9: 0x1046e638c v8::internal::FactoryBase<v8::internal::Factory>::NewRawOneByteString(int, v8::internal::AllocationType) [/Users/sander/.nvm/versions/node/v16.16.0/bin/node]
10: 0x1046edd4c v8::internal::Factory::NewStringFromOneByte(v8::base::Vector<unsigned char const> const&, v8::internal::AllocationType) [/Users/sander/.nvm/versions/node/v16.16.0/bin/node]
11: 0x104a6cc14 v8::internal::Uri::Encode(v8::internal::Isolate*, v8::internal::Handle<v8::internal::String>, bool) [/Users/sander/.nvm/versions/node/v16.16.0/bin/node]
12: 0x10460ebe4 v8::internal::Builtin_GlobalEncodeURI(int, unsigned long*, v8::internal::Isolate*) [/Users/sander/.nvm/versions/node/v16.16.0/bin/node]
13: 0x104d38d0c Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit [/Users/sander/.nvm/versions/node/v16.16.0/bin/node]
14: 0x108f5dca4
15: 0x108fe08f4
16: 0x108fe04e4
17: 0x104d55068 Builtins_ArrayMap [/Users/sander/.nvm/versions/node/v16.16.0/bin/node]
18: 0x108fed1cc
19: 0x108fee784
20: 0x108ff4804
21: 0x108ff9810
22: 0x104cfbd74 Builtins_AsyncFunctionAwaitRejectClosure [/Users/sander/.nvm/versions/node/v16.16.0/bin/node]
23: 0x104d80e38 Builtins_PromiseRejectReactionJob [/Users/sander/.nvm/versions/node/v16.16.0/bin/node]
24: 0x104cee358 Builtins_RunMicrotasks [/Users/sander/.nvm/versions/node/v16.16.0/bin/node]
25: 0x104cca524 Builtins_JSRunMicrotasksEntry [/Users/sander/.nvm/versions/node/v16.16.0/bin/node]
26: 0x10469be5c v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/Users/sander/.nvm/versions/node/v16.16.0/bin/node]
27: 0x10469c290 v8::internal::(anonymous namespace)::InvokeWithTryCatch(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/Users/sander/.nvm/versions/node/v16.16.0/bin/node]
28: 0x10469c37c v8::internal::Execution::TryRunMicrotasks(v8::internal::Isolate*, v8::internal::MicrotaskQueue*, v8::internal::MaybeHandle<v8::internal::Object>*) [/Users/sander/.nvm/versions/node/v16.16.0/bin/node]
29: 0x1046befb8 v8::internal::MicrotaskQueue::RunMicrotasks(v8::internal::Isolate*) [/Users/sander/.nvm/versions/node/v16.16.0/bin/node]
30: 0x1046bf84c v8::internal::MicrotaskQueue::PerformCheckpoint(v8::Isolate*) [/Users/sander/.nvm/versions/node/v16.16.0/bin/node]
31: 0x104389db4 node::InternalCallbackScope::Close() [/Users/sander/.nvm/versions/node/v16.16.0/bin/node]
32: 0x1043897c4 node::InternalCallbackScope::~InternalCallbackScope() [/Users/sander/.nvm/versions/node/v16.16.0/bin/node]
33: 0x10449a498 node::PerIsolatePlatformData::RunForegroundTask(std::__1::unique_ptr<v8::Task, std::__1::default_delete<v8::Task> >) [/Users/sander/.nvm/versions/node/v16.16.0/bin/node]
34: 0x104499128 node::PerIsolatePlatformData::FlushForegroundTasksInternal() [/Users/sander/.nvm/versions/node/v16.16.0/bin/node]
35: 0x104cae370 uv__async_io [/Users/sander/.nvm/versions/node/v16.16.0/bin/node]
36: 0x104cc00e8 uv__io_poll [/Users/sander/.nvm/versions/node/v16.16.0/bin/node]
37: 0x104cae800 uv_run [/Users/sander/.nvm/versions/node/v16.16.0/bin/node]
38: 0x10438accc node::SpinEventLoop(node::Environment*) [/Users/sander/.nvm/versions/node/v16.16.0/bin/node]
39: 0x104475aec node::NodeMainInstance::Run(int*, node::Environment*) [/Users/sander/.nvm/versions/node/v16.16.0/bin/node]
40: 0x1044757b8 node::NodeMainInstance::Run(node::EnvSerializeInfo const*) [/Users/sander/.nvm/versions/node/v16.16.0/bin/node]
41: 0x10440f5c8 node::Start(int, char**) [/Users/sander/.nvm/versions/node/v16.16.0/bin/node]
42: 0x108e6108c
ERROR Command was killed with SIGABRT (Aborted): node ./server/index.mjs 23:21:58
at makeError (node_modules/nuxi/dist/shared/nuxi.759d9bcf.mjs:1256:11)
at handlePromise (node_modules/nuxi/dist/shared/nuxi.759d9bcf.mjs:2088:26)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Object.invoke (node_modules/nuxi/dist/chunks/preview.mjs:62:5)
at async _main (node_modules/nuxi/dist/cli.mjs:46:20)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Issue Analytics
- State:
- Created a year ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Vite project with type: module cannot build #1127 - GitHub
The requested module 'vue-i18n/dist/vue-i18n.runtime.esm-bundler.js' is a CommonJS module, which may not support all module.exports as named exports.
Read more >Vue.js 3 - Error while using Vue I18n plugin in vue - Cannot ...
I'm trying to implement internationalization support for my vue project, but I'm getting error in web-console. Anything I'm doing wrong here ?
Read more >vue-i18n | Yarn - Package Manager
Bridging to Vue 3. We have released a module called vue-i18n-bridge to support Vue 2 applications with Vue I18n v8.x migrate to Vue...
Read more >Nuxt 3 integration - Vue I18n - Intlify
This Nuxt3 application is set up in this tutorial doesn't support advanced i18n, such as URL (routing), SEO with head tag, and lang...
Read more >Releases - i18n-module - Nuxt i18n
Use nuxt3 rc12 on nuxtjs/i18n package with resolution field - by @kazupon (52b36) ... Upgrade vue-i18n-routing for peer deps issue - by @kazupon...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I will create a reproduction repo tomorrow morning.
I don’t want to hijack this topic, as it could be unrelated to @SuperSchek’s initial post after all. It would be great to see, whether the problem is solved for you @SuperSchek .
Still happens here after
npx nuxi-edge@latest upgrade --force
- but only onnpm run build
and serving vianode .output/server/index.mjs
.