2

构建失败并抛出此错误,请帮助我了解安全上下文。项目带有 React 和节点服务器。当我从 webpack 3 迁移到 webpack 4 时,怀疑是 Terser 的问题

clean-webpack-plugin: /home/recaho/work/studioAdminReactWebapp/dist has been removed.

<--- Last few GCs --->

[3060:0x5650c546f2a0]   434948 ms: Mark-sweep 1292.9 (1516.3) -> 1292.8 (1516.3) MB, 1345.3 / 0.0 ms  allocation failure GC in old space requested
[3060:0x5650c546f2a0]   436644 ms: Mark-sweep 1292.8 (1516.3) -> 1292.8 (1468.3) MB, 1510.3 / 0.2 ms  last resort GC in old space requested
[3060:0x5650c546f2a0]   438159 ms: Mark-sweep 1292.8 (1468.3) -> 1292.8 (1453.3) MB, 1514.5 / 0.2 ms  last resort GC in old space requested


<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 0x19250e018fe1 <JSObject>
    2: replace(this=0x35139c76e699 <Very long string[460135]>,0x38bd174c8241 <JSRegExp <String[44]: [\\\b\f\n\r\v\t\x22\x27\u2028\u2029\0\ufeff]>>,0x38bd174c8279 <JSFunction (sfi = 0x155d2bc9691)>)
    3: m(aka m) [/home/recaho/work/studioAdminReactWebapp/node_modules/terser-webpack-plugin/node_modules/terser/dist/bundle.min.js:~1] [pc=0x4481d7fd8af](this=0x19250e002241 <undefined>,t=0x35139c76e...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: node::Abort() [/usr/bin/node]
 2: 0x5650c4173011 [/usr/bin/node]
 3: v8::Utils::ReportOOMFailure(char const*, bool) [/usr/bin/node]
 4: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [/usr/bin/node]
 5: v8::internal::Factory::NewRawOneByteString(int, v8::internal::PretenureFlag) [/usr/bin/node]
 6: v8::internal::String::SlowFlatten(v8::internal::Handle<v8::internal::ConsString>, v8::internal::PretenureFlag) [/usr/bin/node]
 7: v8::internal::Runtime_RegExpExecMultiple(int, v8::internal::Object**, v8::internal::Isolate*) [/usr/bin/node]
 8: 0x4481d6840bd

4

0 回答 0