smb
smb

Reputation: 589

React Build with Jenkins - ERROR: "build-js" exited with 1

I'm currently migrating my local Jenkins to a new EC2 instance and in transferring the UI build pipeline, I currently am getting the following error during build:

ERROR: "build-js" exited with 1.

I had received this previously on the current Jenkins server, however, it was resolved by doing the following:

react-app-rewired --max_old_space_size=4096 build

Server / build details:

t3.large - 2 vCPU and 8gb Ram
Amazon Linux - 64bit x86
Node 16.14.0

I have tried multiple options with the build, however, none of them appear to want to work. The max-old-space doesn't even seem to be doing anything. Not even sure what other options are available.

Upvotes: 1

Views: 1161

Answers (2)

Zheng Bowen
Zheng Bowen

Reputation: 409

The --max_old_space_size indicate how much memory your build process can use, try make it bigger: react-app-rewired --max_old_space_size=8192 build

Upvotes: 0

Damian Busz
Damian Busz

Reputation: 1848

Try to build your react app with CI flag set to false

 "scripts": {
    "build": "CI=false && react-scripts build",
  }

If this doesnt work then try directly change the flag

CI=false react-scripts run build

*react-scripts needs to be replaced depending on wht you use

Upvotes: 2

Related Questions