Node running out of memory when building the app is not something that we would expect.
Can you please share more details about your system, like: your OS version, Node version, available RAM and CPU, the branch that you are trying to build and whether you have made any changes.
and then apparently you need to restart WSL. I believe you can find a rich abundance of learning resources about WSL online.
I believe you would need at least 8GB of memory to run the CHT, and that would be a very bare minimum for development, though I’m afraid more is required for having a smooth experience.
I got this article which actually solved the issue. This particular code helped the web app to compile.
export NODE_OPTIONS=--max-old-space-size=1540
But a new problem arose.
I used 4 terminals of Ubuntu 24.04 to run the webapp.
One for docker, one for web app compile, one for dev api and one for sentinel api. I could not use the fourth one, due to shortage of RAM.
This aligns with your answer, I need at least 8 GB of RAM.
Thanks again for your prompt response. For time being, its a challenge for me to afford a new workstation. I will try to contribute to sectors which requires less compute power such as documentation.
Great to see folks troubleshooting this. I do want to call out what the Microsoft defaults are for these values:
memory - 50% of windows host
processors - same as windows host
swap - 25% of windows host
localhostForwarding - true
So if folks are having issues running the CHT because their WSL2 doesn’t have enough memory, this means their Windows machine has 8GB or less of RAM. While you can tell WSL2 to use up the same amount of RAM physically in your machine, I’m not sure if this is a good idea.
I think a better approach here instead of requesting folks update their config is to instead update our app dev hosting requirements to be “8 GB RAM or more” instead of “4 GB RAM”.
Maybe before we make any changes, @Ubayed_Bin_Sufian - can you confirm how much RAM you physical windows machine has? How much is WSL taking up right now?