'RangeError: Maximum call stack size exceeded '

it2022-05-05  127

本人在项目中使用到vue-cli3+cube-ui的形式,没用用cube-ui提供的vue-cli-plugin-cube-ui的插件,没有去查不同环境下产生的相同的错误是否可以通过此方式解决。

随着项目越来越大,最终在yarn run build的时候出现了堆栈溢出的问题,报错如下:

RangeError: Maximum call stack size exceeded at new Function (<anonymous>) at AsyncSeriesHookCodeFactory.create (E:\MRStarBurstWeb\node_modules\tapable\lib\HookCodeFactory.js:32:10) at AsyncSeriesHook.compile (E:\MRStarBurstWeb\node_modules\tapable\lib\AsyncSeriesHook.js:24:18) at AsyncSeriesHook._createCall (E:\MRStarBurstWeb\node_modules\tapable\lib\Hook.js:24:15) at AsyncSeriesHook.lazyCompileHook [as callAsync] (E:\MRStarBurstWeb\node_modules\tapable\lib\Hook.js:153:21) at source.tapAsync (E:\MRStarBurstWeb\node_modules\enhanced-resolve\lib\ResultPlugin.js:16:26) at AsyncSeriesBailHook.eval [as callAsync] (eval at create (E:\MRStarBurstWeb\node_modules\tapable\lib\HookCodeFactory.js:32:10), <anonymous>:7:1) at Resolver.doResolve (E:\MRStarBurstWeb\node_modules\enhanced-resolve\lib\Resolver.js:235:16) at resolver.getHook.tapAsync (E:\MRStarBurstWeb\node_modules\enhanced-resolve\lib\NextPlugin.js:16:13) at AsyncSeriesBailHook.eval [as callAsync] (eval at create (E:\MRStarBurstWeb\node_modules\tapable\lib\HookCodeFactory.js:32:10), <anonymous>:7:1) at Resolver.doResolve (E:\MRStarBurstWeb\node_modules\enhanced-resolve\lib\Resolver.js:235:16) at fs.stat (E:\MRStarBurstWeb\node_modules\enhanced-resolve\lib\FileExistsPlugin.js:29:14) at process.nextTick (E:\MRStarBurstWeb\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:73:15) at process._tickCallback (internal/process/next_tick.js:61:11) error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

比较焦头烂额,寻迹于各大论坛和网站,都没有找到类似的情况。最后还是在Github上看到了解决方法。 附上链接,大家也可以延伸去解决其他的问题 vuejs/vue-cli#3091 cube-ui/issues 拜谢两位大佬,提供了思路

最后的解决方式如下: 在vue.config.js中加入以下语句 extract: false


最新回复(0)