Shakapacker fails silently

Currently I am upgrading from webpacker to shakapacker in our application. After upgrading my stuff is compiled on local but when I try to compile my application on circleci, it is failing silently with below message.

I, [2023-03-13T13:38:31.525774 #1506]  INFO -- : Compiling...
E, [2023-03-13T13:39:37.698412 #1506] ERROR -- : 
COMPILATION FAILED:
EXIT STATUS: pid 1531 SIGKILL (signal 9)
OUTPUTS:
Loading ENV specific webpack configuration file /home/circleci/***/config/webpack/test.js
Compiling test webpacker...

There is no other error being sent. I have tried ssh into the ci and there is no logs being added. One thing I found was the CPU and RAM usage is upto 100% when the compile process fails. Currently we have 4gb resource class and we have set node optiont as well to NODE_OPTIONS: --max_old_space_size=2536 Can anyone help me on understanding what is issue here?

:wave: Hello @suyogshiftcare, and welcome to the CircleCI community!

I believe you already identified the cause of this issue:

I found was the CPU and RAM usage is upto 100% when the compile process fails.

The first thing I’d suggest is to try with a bigger resource class.

You could also record the job’s memory usage to find exactly which process(es) are responsible for the high memory utilization.

Also, note that if you have specified export NODE_OPTIONS=<value> in your package.json, it’ll override the value you set in the NODE_OPTIONS environment variable.