next.js 下一个抛出错误:node::loader::ImportModuleDynamically

jckbn6z7  于 2023-03-22  发布在  其他
关注(0)|答案(1)|浏览(268)

我正在使用t3堆栈和任何使用next启动服务器的项目,例如这个项目,程序通过了这个错误。

node[20481]: ../src/module_wrap.cc:599:MaybeLocal<v8::Promise> node::loader::ImportModuleDynamically(Local<v8::Context>, Local<v8::Data>, Local<v8::Value>, Local<v8::String>, Local<v8::FixedArray>): Assertion `(it) != (env->id_to_function_map.end())' failed.
1: 0x102f7e100 node::Abort() [/opt/homebrew/Cellar/node/19.8.0/bin/node]
2: 0x102f7e0e4 node::Abort() [/opt/homebrew/Cellar/node/19.8.0/bin/node]
3: 0x102f4183c node::loader::ImportModuleDynamically(v8::Local<v8::Context>, v8::Local<v8::Data>, v8::Local<v8::Value>, v8::Local<v8::String>, v8::Local<v8::FixedArray>) [/opt/homebrew/Cellar/node/19.8.0/bin/node]
4: 0x103215e54 v8::internal::Isolate::RunHostImportModuleDynamicallyCallback(v8::internal::MaybeHandle<v8::internal::Script>, v8::internal::Handle<v8::internal::Object>, v8::internal::MaybeHandle<v8::internal::Object>) [/opt/homebrew/Cellar/node/19.8.0/bin/node]
5: 0x1035b7724 v8::internal::Runtime_DynamicImportCall(int, unsigned long*, v8::internal::Isolate*) [/opt/homebrew/Cellar/node/19.8.0/bin/node]
6: 0x102dd3524 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvInRegister_NoBuiltinExit [/opt/homebrew/Cellar/node/19.8.0/bin/node]
7: 0x102e7849c Builtins_CallRuntimeHandler [/opt/homebrew/Cellar/node/19.8.0/bin/node]
8: 0x102d50064 Builtins_InterpreterEntryTrampoline [/opt/homebrew/Cellar/node/19.8.0/bin/node]
9: 0x102d868b4 Builtins_AsyncFunctionAwaitResolveClosure [/opt/homebrew/Cellar/node/19.8.0/bin/node]
10: 0x102e26e38 Builtins_PromiseFulfillReactionJob [/opt/homebrew/Cellar/node/19.8.0/bin/node]
11: 0x102d76834 Builtins_RunMicrotasks [/opt/homebrew/Cellar/node/19.8.0/bin/node]
12: 0x102d4e3c4 Builtins_JSRunMicrotasksEntry [/opt/homebrew/Cellar/node/19.8.0/bin/node]
13: 0x1031fad74 v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/opt/homebrew/Cellar/node/19.8.0/bin/node]
14: 0x1031fb4bc v8::internal::(anonymous namespace)::InvokeWithTryCatch(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/opt/homebrew/Cellar/node/19.8.0/bin/node]
15: 0x10321df90 v8::internal::MicrotaskQueue::RunMicrotasks(v8::internal::Isolate*) [/opt/homebrew/Cellar/node/19.8.0/bin/node]
16: 0x10321ddc0 v8::internal::MicrotaskQueue::PerformCheckpointInternal(v8::Isolate*) [/opt/homebrew/Cellar/node/19.8.0/bin/node]
17: 0x102eb0ae8 node::InternalCallbackScope::Close() [/opt/homebrew/Cellar/node/19.8.0/bin/node]
18: 0x102eb0ff4 node::InternalMakeCallback(node::Environment*, v8::Local<v8::Object>, v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*, node::async_context) [/opt/homebrew/Cellar/node/19.8.0/bin/node]
19: 0x102ecc7a8 node::AsyncWrap::MakeCallback(v8::Local<v8::Function>, int, v8::Local<v8::Value>*) [/opt/homebrew/Cellar/node/19.8.0/bin/node]
20: 0x102f852ec node::fs::FSReqCallback::Resolve(v8::Local<v8::Value>) [/opt/homebrew/Cellar/node/19.8.0/bin/node]
21: 0x102f86cec node::fs::AfterStat(uv_fs_s*) [/opt/homebrew/Cellar/node/19.8.0/bin/node]
23: 0x105a26ff0 uv__work_done [/opt/homebrew/Cellar/libuv/1.44.2/lib/libuv.1.dylib]
24: 0x105a2a3c4 uv__async_io [/opt/homebrew/Cellar/libuv/1.44.2/lib/libuv.1.dylib]
25: 0x105a3a1e0 uv__io_poll [/opt/homebrew/Cellar/libuv/1.44.2/lib/libuv.1.dylib]
26: 0x105a2a7bc uv_run [/opt/homebrew/Cellar/libuv/1.44.2/lib/libuv.1.dylib]
27: 0x102eb18a8 node::SpinEventLoopInternal(node::Environment*) [/opt/homebrew/Cellar/node/19.8.0/bin/node]
28: 0x102fc01ec node::NodeMainInstance::Run(node::ExitCode*, node::Environment*) [/opt/homebrew/Cellar/node/19.8.0/bin/node]
29: 0x102fbff6c node::NodeMainInstance::Run() [/opt/homebrew/Cellar/node/19.8.0/bin/node]
30: 0x102f46830 node::LoadSnapshotDataAndRun(node::SnapshotData const**, node::InitializationResultImpl const*) [/opt/homebrew/Cellar/node/19.8.0/bin/node]
31: 0x102f469b4 node::Start(int, char**) [/opt/homebrew/Cellar/node/19.8.0/bin/node]
32: 0x105c8108c
[1]    20481 abort      next

我尝试重新安装packages和node_modules文件夹,并将next作为全局节点依赖项安装。

jobtbby3

jobtbby31#

我在将nodejs更新到19.8.0版本后遇到了同样的问题。降级回19.7.0会有所帮助。
如果你正在运行Arch Linux,你可以找到旧版本的here

相关问题