Problem description
After the project is run and compiled, the problem of running interruption occurs frequently. You need to re execute the command yarn serve
Error content
<--- JS stacktrace --->
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
The JS heap is out of memory
Cause analysis:
If the project is large, memory overflow will be thrown when starting or packaging, and the node server memory needs to be expanded
Solution:
Try method 1: Expand memory
Shortcut key Win+R to open the run window, run npm install -g increase-memory-limit 2. Run increase-memory-limit
in the project folder , the memory expansion is completed, and then start the project.
The situation is slightly better after the expansion, but the operation will be interrupted when throwing
CALL_AND_RETRY_LAST Allocation failed – JavaScript heap out of memory
Try method 2: Shortcut key Win+R to open the run window, run setx NODE_OPTIONS –max_old_space_size=4096
Subsequent operation is normal, no error is reported
Read More:
- [Solved] Project Package Error: Javascript heap out of memory
- [Solved] Vue-cli3 running or packaging error: JS memory overflow
- [Solved] NPM Error: FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed
- [Go]Understand the golang project performance analysis tool PProf
- [Solved] Vue Compile Error: JavaScript heap out of memory
- [Solved] Vue Error: /sockjs-node/info?t=
- [Solved] NPM node ERROR in main..js from Terser ChildProcessWorker.initialize Excaption
- [Solved] VS Code Error: Vetur can‘t find ‘tsconfig.json‘ or ‘jsconfig.json‘
- [Solved] node-xlsx Write excel Error: TypeError: n.indexOf is not a function
- OTS parsing error: invalid version tag [How to Solve]
- [Solved] VS Code Debug JavaScript Error: “crbug/1173575, non-JS module files deprecated”
- [Solved] Warning: To load an ES module, set “type“: “module“ in the package.json or use the .mjs extension
- [Solved] Vite packing error: some chunks are larger than 500kb after minification
- [Solved] ERROR Error loading vue.config.js: ERROR Error: Command failed: git describe
- [Solved] Vue Project Error: Module build failed: Error: Missing binding
- [Solved] Vue Error: Uncaught TypeError: Vue.createApp is not a function
- [Solved] error C:\Users\HP\Desktop\VueProject\vue_cli\node_modules\node-sass: Command failed.Exit code: 1
- Vue3 + vite install element-plus error [How to Solve]
- [Solved] Node sass version 7.0.0 is incompatible with ^ 4.0.0 | ^ 5.0.0 | ^ 6.0.0
- [Solved] Syntax Error: Error: Cannot find module ‘cache-loader‘