1

I am facing an issue in webpack sample while getting webpack build:

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

package.json

"build": "rimraf dist && node_modules\\.bin\\webpack --config config/webpack.prod.js --progress --profile --bail",
lmiguelvargasf
  • 63,191
  • 45
  • 217
  • 228
Kbvin
  • 216
  • 3
  • 13

1 Answers1

0

Every single time when i got the same error i managed to solve the issue using the --max_old_space_size option.

My guess would be that either --max_old_space_size=4096 is not enough (just use a higher value) or that the option is not applied in the right place.

I would try:

"build": "rimraf dist && node --max-old-space-size=8192 node_modules\\.bin\\webpack --config config/webpack.prod.js --progress --profile --bail"
Davidiusdadi
  • 511
  • 1
  • 7
  • 14