I've been working on my Angular 8 Universal project for a month. Everything was OK with making SSR builds but a couple of days ago I got stuck with this strange behavior of Webpack or Angular framework, I don't know.
I get the error :
65% building 464/465 modules 1 active p:\web\nodejs projects\ng-express\dist\server.js
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
and I noticed that the dist/server.js file is larger than...50MB! It's a bit strange.
I tried to find any solutions but all of them concern making just a build but not SSR build:
node --max_old_space_size=4096 ./node_modules/.bin/ng build --prod --aot
I need to execute: "npm run build:ssr" command and it's impossible to add "node --max_old_space_size=4096" command before my one.
To be honest, why I receive this error at all? How to sort it out?
Any help would be highly appreciated!