FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory

Has anyone converted a React TSX project to JSX? I am trying to do so and am wondering how. The reason why I am doing this is because encountered an error while building,
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
I am using the AWS free tier and increasing heap size not and options for me
--max-old-space-size=4096
--max-old-space-size=4096
I tried to convert each file separately with the tsc compiler, but it is giving me compiled JSX even after setting:
"js": "preserve"
"js": "preserve"
I presume this is happening because of an extra layer due to tsc converting to JSX. Sorry, this might be a completely gauche assumption. Can anyone point me in the right direction?
1 Reply
JulieCezar
JulieCezar•4mo ago
If you got this message, going from TSX to JSX wont help, on the contrary it might get you more problems. Also, I don't know what made you try this but please don't ever do that again 🤣 Firstly, try to delete node_modules, reinstall all deps, and try to build locally. Also, I need more info... like is this specific to AWS? Can you build locally? What are you using to deploy to AWS?...
Want results from more Discord servers?
Add your server