React App build failed: "The build failed because the process exited too early."

When building my react app, i’m seeing this error:

#!/bin/bash -eo pipefail
npm run build

> my-app@0.1.0 build
> react-app-rewired build

Creating an optimized production build...
The build failed because the process exited too early. This probably means the system ran out of memory or someone called `kill -9` on the process.

Exited with code exit status 1
CircleCI received exit code 1

I have a matrix that runs the build on different node versions but those (2 others) pass but for some reason fails on this version (node 16.16.0) with this message. Re-running the test starting from where it failed doesn’t work either. seems to always fail like this.

anyone have any

1 Like

Hi @tantommy,
The first thing I’d try is adding this to the job to get more memory:

resource_class: large   

Large resources are even included in the free plan.


      - image: cimg/node:16.18
    resource_class: large
      - checkout

It might not fix it, but it’s really easy to try.