【发布时间】:2021-09-19 01:35:08
【问题描述】:
我的 React 应用程序构建失败并出现(经过两天的试验)可怕的“JavaScript 堆内存不足”。
我已经尝试了许多帖子中的建议,包括:
This one (“many”表示“在第十次尝试之后你可以说你已经尝试了'many and any'选项)。
但一切都以失败告终。
<--- Last few GCs --->
[12207:0x4e75380] 177858 ms: Mark-sweep (reduce) 2044.8 (2080.0) -> 2042.4 (2073.5) MB, 938.5 / 0.1 ms (+ 350.7 ms in 41 steps since start of marking, biggest step 18.9 ms, walltime since start of marking 1302 ms) (average mu = 0.154, current mu = 0.10[12207:0x4e75380] 177863 ms: Scavenge 2043.5 (2073.5) -> 2042.6 (2074.5) MB, 2.6 / 0.0 ms (average mu = 0.154, current mu = 0.103) allocation failure
<--- JS stacktrace --->
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
1: 0xb200e0 node::Abort() [node]
2: 0xa3c157 node::FatalError(char const*, char const*) [node]
3: 0xd083ae v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
4: 0xd08727 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
5: 0xee9785 [node]
6: 0xeea2cc [node]
7: 0xef8269 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
8: 0xefb5ac v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
9: 0xec000c v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [node]
10: 0x123695b v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [node]
11: 0x1640839 [node]
奇怪的部分是同一个项目无法在某些 Firebase 依赖项 google-gax 中加载某些包。
由(可能)错误的 'require' 调用引起
内存错误是否与此 google 包“拼写错误”有关。反映项目中隐藏的某些东西。
P.D.:这个错误只发生在这个分支中。同一项目的其他分支不会失败。
P.D.:google-gax 错误需要(手动)更正才能编译(或尝试这样做)项目。
【问题讨论】:
标签: javascript node.js reactjs firebase google-cloud-platform