I have a normal react setup, without CRA, which means I manually configured webpack and babel etc... I currently have 2 scripts which run webpack : package.json :
"scripts": {
"dev": "NODE_OPTIONS='--openssl-legacy-provider --max-old-space-size=8000' webpack --watch --config webpack.dev.js",
"prod": "NODE_OPTIONS='--openssl-legacy-provider' webpack --config webpack.prod.js"
},
when I run npm run prod
, the issue does not happen and all the assets get compiled like normal. However, when i run npm run dev
, after working for a while (less than an hour), the terminal kills webpack and shows the following:
I'm not sure what is happening here but I saw some recommendations to circumvent the issue by adding --max-old-space-size=8000
to the NODE_OPTIONS in the script.
However the issue persists. Any idea How to deal with it ?