【报错】FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out o

打包失败遇到这样的提示

<— Last few GCs —>

[1353:0x32cc3b8] 321299 ms: Mark-sweep 471.1 (509.7) -> 464.8 (511.2) MB, 1572.0 / 0.0 ms (average mu = 0.234, current mu = 0.168) allocation f
ailure scavenge might not succeed[1353:0x32cc3b8] 323200 ms: Mark-sweep 471.5 (511.2) -> 465.2 (512.2) MB, 1573.6 / 0.0 ms (average mu = 0.204, current mu = 0.172) allocation f
ailure scavenge might not succeed

<— JS stacktrace —>

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

0: ExitFrame [pc: 0x14f196c]

Security context: 0x5270dbd5
1: get [0x3b187485] [/root/virt-access/virt-access/node_modules/babel-traverse/lib/path/family.js:~134] [pc=0x5cb0c8c8](this=0x22b1b45d ,0x5274d1f5 <String[#10]: expression>,0x3ee80289 ) 2: ExpressionStatement [0x27cc3199] [/root/virt-access/virt-access/node_modules/babel-plugin-minify-dead-code-elimination/lib/index.js:4…

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

在这里插入图片描述

报错说得很明显了,内存不足
解决方法也很简单
在打包命令里设置max-old-space-size即可
但为什么项目中引入three.js后就出现这个问题,记录下

猜你喜欢

转载自blog.csdn.net/weixin_42050406/article/details/107980933