When I'm working with a webpack-dev server, the problem sometimes occurs
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
more here
Config webpack.config.js
"webpack": "^4.5.0",
"webpack-cli": "^2.0.14",
"webpack-dev-server": "^3.1.3",
NodeJS version:
node -v
v9.3.0
OS version:
macOS High Sierra 10.13.6
Has anyone encountered a similar problem?
node --max-old-space-size=8192 node_modules/webpack-dev-server/bin/webpack-dev-server.js
Run above command instead of running npm start
Increase your node process's memory limit. Start node
with command-line flag --max-old-space-size=2048
(to 2GB, default is 512 MB I think), or set it via environment variable NODE_OPTS
https://nodejs.org/api/cli.html
You might get away with the following. The issue is caused by a memory leak in postcss-loader. The one liner below has worked for some.
rm -rf [package-lock.json] node_modules && npm cache clean -f && npm i
For more information: https://github.com/webpack/webpack/issues/6929
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With