UglifyJs RangeError: Maximum call stack size exceeded

发布于 2022-09-12 13:03:02 字数 2504 浏览 21 评论 0

环境信息:
vue-cli@3.0
webpack@4+

yarn build工程时,报错:

RangeError: Maximum call stack size exceeded
at AST_Call.eval [as _eval] (eval at <anonymous> node_modules/uglifyjs-webpack-plugin/node_modu
les/uglify-js/tools/node.js:18:1), <anonymous>:9182:31)

at AST_Call.eval [as evaluate] (eval at <anonymous> (/node_modules/uglifyjs-webpack-plugin/node_m
odules/uglify-js/tools/node.js:18:1), <anonymous>:8833:28)

at TreeWalker.eval [as callback] (eval at <anonymous> (/node_modules/uglifyjs-webpack-plugin/node
_modules/uglify-js/tools/node.js:18:1), <anonymous>:9196:62)
    at TreeWalker.visit (eval at <anonymous> (/node_modules/uglifyjs-webpack-plugin/node_modules/ugli
fy-js/tools/node.js:18:1), <anonymous>:1437:25)
    at AST_Return.walk (eval at <anonymous> (/node_modules/uglifyjs-webpack-plugin/node_modules/uglif
y-js/tools/node.js:18:1), <anonymous>:811:17)
    at eval (eval at <anonymous> (/node_modules/uglifyjs-webpack-plugin/node_modules/uglify-js/tools/
node.js:18:1), <anonymous>:495:14)
    at Array.forEach (<anonymous>)
    at walk_body (eval at <anonymous> (/node_modules/uglifyjs-webpack-plugin/node_modules/uglify-js/t
ools/node.js:18:1), <anonymous>:494:15)
    at eval (eval at <anonymous> (/node_modules/uglifyjs-webpack-plugin/node_modules/uglify-js/tools/node.js:18:1), <anonymous>:507:13)
    at TreeWalker.visit (eval at <anonymous> (/node_modules/uglifyjs-webpack-plugin/node_modules/uglify-js/tools/node.js:18:1), <anonymous>:1438:31)
    at AST_BlockStatement.walk (eval at <anonymous> (/node_modules/uglifyjs-webpack-plugin/node_modules/uglify-js/tools/node.js:18:1), <anonymous>:506:17)
    at eval (eval at <anonymous> (/node_modules/uglifyjs-webpack-plugin/node_modules/uglify-js/tools/node.js:18:1), <anonymous>:869:23)
    at TreeWalker.visit (eval at <anonymous> (/node_modules/uglifyjs-webpack-plugin/node_modules/uglify-js/tools/node.js:18:1), <anonymous>:1438:31)
    at AST_If.walk (eval at <anonymous> (/node_modules/uglifyjs-webpack-plugin/node_modules/uglify-js/tools/node.js:18:1), <anonymous>:867:17)
    at eval (eval at <anonymous> (/node_modules/uglifyjs-webpack-plugin/node_modules/uglify-js/tools/node.js:18:1), <anonymous>:495:14)
    at Array.forEach (<anonymous>)

如果在vue.conf.js中去掉uglifyjs-webpack-plugin插件就OK了,有哪位遇到相同问题的吗????

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

雪化雨蝶 2022-09-19 13:03:02

遇到了还没解决,换 terser-webpack-plugin 试试

辞取 2022-09-19 13:03:02

丑化需要的内存太大了导致堆栈溢出了
image

在node_modules/.bin/webpack.cmd这个目录下加上这个--max_old_space_size=4096试试看

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文