R
Railway16mo ago
vas

RpcIpcMessagePortClosedError: Process 38 exited [SIGKILL].

Hi, I'm deploying a ReactJS app, the build succeeds, it gets containerized and on deployment I get this error: ------------------------------------------------
react-scripts start
(node:27) [DEP_WEBPACK_DEV_SERVER_ON_AFTER_SETUP_MIDDLEWARE] DeprecationWarning: 'onAfterSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option. (Use node --trace-deprecation ... to show where the warning was created) (node:27) [DEP_WEBPACK_DEV_SERVER_ON_BEFORE_SETUP_MIDDLEWARE] DeprecationWarning: 'onBeforeSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option. Starting the development server... /app/node_modules/react-scripts/scripts/start.js:19 throw err; ^ RpcIpcMessagePortClosedError: Process 38 exited [SIGKILL]. at /app/node_modules/fork-ts-checker-webpack-plugin/lib/rpc/rpc-ipc/RpcIpcMessagePort.js:19:23 at Generator.next (<anonymous>) at /app/node_modules/fork-ts-checker-webpack-plugin/lib/rpc/rpc-ipc/RpcIpcMessagePort.js:8:71 at new Promise (<anonymous>) at __awaiter (/app/node_modules/fork-ts-checker-webpack-plugin/lib/rpc/rpc-ipc/RpcIpcMessagePort.js:4:12) at ChildProcess.handleExit (/app/node_modules/fork-ts-checker-webpack-plugin/lib/rpc/rpc-ipc/RpcIpcMessagePort.js:18:42) at ChildProcess.emit (node:events:513:28) at ChildProcess._handle.onexit (node:internal/child_process:291:12) { code: null, signal: 'SIGKILL' --------------------------------- I've tried: - checking all my dependencies and resetting them - I was running node 18.5 and changed railway to 18.21 (highest it can go) - changed my node to match to 18.21 - added webpack.config.js -> useTypeScriptIncrementalApi: false - added --max_old_space_size=4096 as an ENV var, and to the start command (also have legacy-peer-deps=true in .npmrc) build=100s, publish=25s, deploy fails in 10s all works fine on local and fails with this on railway. According to metrics, the most memory goes up to=450MB, and CPU is 20-25%, network in=35B, out=0B... Does anyone have any idea?
22 Replies
Percy
Percy16mo ago
Project ID: N/A
Percy
Percy16mo ago
You might find these helpful: - React deployment fails - Migration from Heroku failed
⚠️ experimental feature
vas
vas16mo ago
N/A
Brody
Brody16mo ago
react-scripts start starts a development server and should never be used in production, you want to build your app then serve the built files with something like serve
vas
vas16mo ago
thanks for the tip, but can you expand on how it applies to the issue I've shared in terms of getting the server up?
Brody
Brody16mo ago
the development server uses more ram than you are allocated on the free plan thus it gets killed
vas
vas16mo ago
I see...
Brody
Brody16mo ago
^ serve will use approximately 70-100mb depending on load
vas
vas16mo ago
according to the metrics it's now using 455MB (when crashing) -> isn't the allocation 4GB?
Brody
Brody16mo ago
no free tier is 512mb
vas
vas16mo ago
right, thanks for this...and how much would you say the dev server uses?
Brody
Brody16mo ago
it uses 455mb like you just said
vas
vas16mo ago
hahah well if I have 512, wouldn't that cover it? out of mem makes sense in terms of what I've seen out there for this error but just wondering...
Brody
Brody16mo ago
455mb is dangerously close to 512mb so your app would get killed for a memory spike that might not even show up on the metrics but you don't want to run the dev server on railway even if you had enough memory, can't stress that enough
vas
vas16mo ago
what's the main concern with that? (asking as my main concern right now is speed)
Brody
Brody16mo ago
it would be speed, you are spot on and memory, it could grow exponentially since it was already 455mb without any connections
vas
vas16mo ago
yeah...makes sense. Thanks a lot!
Brody
Brody16mo ago
so look into getting your app built and then serving those static files with serve
vas
vas16mo ago
one last thing, how do I mark this as solved?
Brody
Brody16mo ago
I can do that, dw
vas
vas16mo ago
thank you!
Brody
Brody16mo ago
no problem!