JAVASCRIPT HEAP OUT OF MEMORY ON EVERY AN ANGULAR CLI PROJECT BUILD SINCE YESTERDAY. NOTHING CHANGED!

Solvedbuildjavascriptnpm2 replies · 176 views · started
Accepted solution by Cleo — for JavaScript heap out of memory, raise teh limit for the build: NODE OPTIONS= max old space size=4096 npm run build. if it keeps…
  1. ok so local build works, CI build fails... classic. the CI log ends with:

    $ npm install

    $ npm install
    npm ERR! code ERESOLVE
    npm ERR! ERESOLVE unable to resolve dependency tree
    npm ERR!
    npm ERR! While resolving: my-dashboard@0.1.0
    npm ERR! Found: react@19.x
    npm ERR! node_modules/react
    npm ERR!   react@"^19" from the root project
    npm ERR!
    npm ERR! Could not resolve dependency:
    npm ERR! peer react@"^17 || ^18" from some-chart-lib@x
    npm ERR!
    npm ERR! Fix the upstream dependency conflict, or retry
    npm ERR! this command with --force or --legacy-peer-deps
    

    JavaScript heap out of memory 😅 Its a an Angular CLI project project with a fairly stanadrd setup. I suspect a version difference between my machine and teh CI runner, but I dont know which version matters: Node, npm, or one of teh packages. How do you track down this kinda mismatch? 🔥 Any guidance on making local and CI builds behave the same would be great.

    facepalm

    4
  2. Accepted solution

    for JavaScript heap out of memory, raise teh limit for the build: NODE_OPTIONS=--max-old-space-size=4096 npm run build. if it keeps growing, look for huge source maps, giant JSON imports or an accidental import of a whole library. fingers crossed 🤞

    3 9 helpful
  3. @bufferwrangler Moved the server-only import out of the shared file and the build passes. Makes total sense now that i understand the error. cant believe it was that simple lol

    15 0 helpful

Reply to this topic

Sign in or create an account to reply.