3

I'm trying to build react-application(create-app-react based) for production using react-scripts, but I'm getting error on npm run build:

Creating an optimized production build...Completed in 69ms
/var/www/html/test_project/node_modules/react-scripts/scripts/build.js:19
  throw err;
  ^

RpcIpcMessagePortClosedError: Process 701148 exited [SIGKILL].
    at /var/www/html/test_project/node_modules/fork-ts-checker-webpack-plugin/lib/rpc/rpc-ipc/RpcIpcMessagePort.js:19:23
    at Generator.next (<anonymous>)
    at /var/www/html/test_project/node_modules/fork-ts-checker-webpack-plugin/lib/rpc/rpc-ipc/RpcIpcMessagePort.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (/var/www/html/test_project/node_modules/fork-ts-checker-webpack-plugin/lib/rpc/rpc-ipc/RpcIpcMessagePort.js:4:12)
    at ChildProcess.handleExit (/var/www/html/test_project/node_modules/fork-ts-checker-webpack-plugin/lib/rpc/rpc-ipc/RpcIpcMessagePort.js:18:42)
    at ChildProcess.emit (events.js:400:28)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:285:12) {
  code: null,
  signal: 'SIGKILL'

I'm using node-js v14.19.3 and npm 8.12.1

--verbose mode didnt provide any useful details in logs. Maybe somebody had such cases. How this error can be fixed?

3
  • Hi, I have the same error, did you manage to find a fix? Commented Jul 21, 2022 at 13:08
  • 1
    @MarkHayward hi Mark. yes. I increased swap size on server and it works fine. I suppose, that such errors usually refer to lack of server resources. Commented Jul 21, 2022 at 14:48
  • But nobody knows how to get better errors out of react-scripts build? My error is completely different and I don't even know which stage of build is causing it. It seems to be related to an scss file but complains about Array.forEach 🤷 Commented Sep 8, 2022 at 22:44

1 Answer 1

6

Hitting the same problem currently

The problem is a lack of memory. That results in undefined behavour of fork-ts-checker-webpack-plugin. Here in the related discussion they mention memory limit for npm.

@Keavon Did you try increase the memory limit in the config?

That just made me to check that. The propblem is my virtual server's having 1Gb of operating memory. This is just not enought for running build.

You may check your memory consumption using top

before running build:

before running build

in the proccess of running build:

while running build

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.