R
Railway2y 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
Percy2y ago
Project ID: N/A
Percy
Percy2y ago
You might find these helpful: - React deployment fails - Migration from Heroku failed
⚠️ experimental feature
vas
vasOP2y ago
N/A
Brody
Brody2y 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
vasOP2y 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
Brody2y ago
the development server uses more ram than you are allocated on the free plan thus it gets killed
vas
vasOP2y ago
I see...
Brody
Brody2y ago
^ serve will use approximately 70-100mb depending on load
vas
vasOP2y ago
according to the metrics it's now using 455MB (when crashing) -> isn't the allocation 4GB?
Brody
Brody2y ago
no free tier is 512mb
vas
vasOP2y ago
right, thanks for this...and how much would you say the dev server uses?
Brody
Brody2y ago
it uses 455mb like you just said
vas
vasOP2y 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
Brody2y 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
vasOP2y ago
what's the main concern with that? (asking as my main concern right now is speed)
Brody
Brody2y ago
it would be speed, you are spot on and memory, it could grow exponentially since it was already 455mb without any connections
vas
vasOP2y ago
yeah...makes sense. Thanks a lot!
Brody
Brody2y ago
so look into getting your app built and then serving those static files with serve
vas
vasOP2y ago
one last thing, how do I mark this as solved?
Brody
Brody2y ago
I can do that, dw
vas
vasOP2y ago
thank you!
Brody
Brody2y ago
no problem!
Want results from more Discord servers?
Add your server