I’m trying to deploy my React / Symfony app on my server. Everything works fine locally, but when I’m trying to run npm run build
on my server then it takes a long time (around 5 to 10 minutes, and almost every time I have this error
#30 [frontend build 6/6] RUN npm run build
#30 0.747
#30 0.747 > [email protected] build
#30 0.747 > react-scripts --max_old_space_size=4096 build
#30 0.747
#30 4.590 Creating an optimized production build...
#30 332.7 The build failed because the process exited too early. This probably means the system ran out of memory or someone called `kill -9` on the process.
#30 ERROR: process "/bin/sh -c npm run build" did not complete successfully: exit code: 1
------
> [frontend build 6/6] RUN npm run build:
0.747
0.747 > [email protected] build
0.747 > react-scripts --max_old_space_size=4096 build
0.747
4.590 Creating an optimized production build...
332.7 The build failed because the process exited too early. This probably means the system ran out of memory or someone called `kill -9` on the process.
------
failed to solve: process "/bin/sh -c npm run build" did not complete successfully: exit code: 1
So I tried to figure what could be the issue, and found that if I removed react-icons comletely from my project, build would work, and in 1 minute or 2 !
Without react icons
With react icons
You can see in the first image the process without react icons (2 min 12), then the same but I add react icons in the second image (6 min +)
I just don’t know where I can go, if someone knows what can be the issue I’d be so grateful !
Corentin Ancel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.