Stuck on Creating an optimized production build
forever when development server is running
#60147
Replies: 79 comments 2 replies
-
Facing the same issue |
Beta Was this translation helpful? Give feedback.
-
i have same issue !! |
Beta Was this translation helpful? Give feedback.
-
Execute the steps of “ creating an optimized production build ” on the Linux server node v14.17.0 |
Beta Was this translation helpful? Give feedback.
-
same issue |
Beta Was this translation helpful? Give feedback.
-
Same issue for us |
Beta Was this translation helpful? Give feedback.
-
The same issue still exists.... any remedies. In my case, it was hours I stuck at this "creating an optimized production build". And also I didn't run the development server in the background. |
Beta Was this translation helpful? Give feedback.
-
same issue! |
Beta Was this translation helpful? Give feedback.
-
Same issue for React.js project as well even when development server is not running on |
Beta Was this translation helpful? Give feedback.
-
I have the same issue!!! |
Beta Was this translation helpful? Give feedback.
-
Same Issue. In development it worked, but when I try to create the Docker image it stuck |
Beta Was this translation helpful? Give feedback.
-
I solved with the next steps:
|
Beta Was this translation helpful? Give feedback.
-
Same issue but I wasn't aware that this was happening due the open dev webserver. So the solution for me is on your title: close the development server, then run |
Beta Was this translation helpful? Give feedback.
-
I am still facing the same issue. Using the latest NextJs 12.3.2-canary.34 facing this issue since I'm trying 12.3.2-carany.+ |
Beta Was this translation helpful? Give feedback.
-
You can't have both dev and build at the same time. I solved it very quickly when I realized that there were several nodejs processes open when there should only be 1, and killing all the nodejs processes that were running in the background solved it for me.It can also happen that a build started to fail and got stuck in the background so you should kill all the nodejs you see running in the task manager. I am using Nextjs 13 |
Beta Was this translation helpful? Give feedback.
-
Mine was also solved. I faced this issue because a dependency wasn't comfortable with the latest nextjs. 🙃 |
Beta Was this translation helpful? Give feedback.
-
I solved it by fixed eslint version. "eslint": "8.34.0",
"eslint-config-next": "13.2.1", |
Beta Was this translation helpful? Give feedback.
-
Great to hear! I will try this. |
Beta Was this translation helpful? Give feedback.
-
In my case, I suspected that it was some virtualization issue, and I was right. Once I disabled |
Beta Was this translation helpful? Give feedback.
-
I tried OrbStack, it gave a nice performance boost, but it did not solve the issue. |
Beta Was this translation helpful? Give feedback.
-
I solved this issue by using CMD in the final build step instead of RUN RUN npm run build CMD [ "npm", "run", "start" ] |
Beta Was this translation helpful? Give feedback.
-
i just upgraded nodejs to the latest version and worked like a charm |
Beta Was this translation helpful? Give feedback.
-
Extremely helpful - we'd removed a dependency with a transitive dependency we relied on implicitly. We were only able to determine this with the above process log. |
Beta Was this translation helpful? Give feedback.
-
I actually had this problem and I managed to fix it by upgrading my Linux machine memory |
Beta Was this translation helpful? Give feedback.
-
Hi everyone! I will be moving this to We still encourage folks to file bugs outside of this thread detailing the exact issue, with a Happy 2024! |
Beta Was this translation helpful? Give feedback.
-
i also have this issue it work fine on my mac m1 pro 32gb but not on starter packakge on vps service like (5 usd digital ocean,ligstsale ,linode) it will take forever |
Beta Was this translation helpful? Give feedback.
-
Same here while building on Self managed GitLab (Kubernetes cluster + kubernetes runner) |
Beta Was this translation helpful? Give feedback.
-
Same here, I've tried:
None of them worked, it just stuck on |
Beta Was this translation helpful? Give feedback.
-
Same! so what the heck going on when npm run build inside docker |
Beta Was this translation helpful? Give feedback.
-
In my case, it works fine when I run build on my local machine but it gets stuck forever when building docker image. I was using "oven/bun" as my base docker image and I suspected that the issue is from bun's image. So, I switched to "node:20.11.1-slim" base docker image and I ran "npm install -g bun" in my Dockerfile to install bun and it worked like a charm! I hope this helps someone |
Beta Was this translation helpful? Give feedback.
-
Verify canary release
Provide environment information
Operating System:
Platform: win32
Arch: x64
Version: Windows 10 Pro
Binaries:
Node: 16.13.0
npm: N/A
Yarn: N/A
pnpm: 6.24.0-1
Relevant packages:
next: 12.1.4
react: 17.0.2
react-dom: 17.0.2
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Describe the Bug
I had my development server running in the background without me remembering and I wanted to build my app using
next build
, that's what I've got:And I was stuck for 30 minutes on
info - Creating an optimized production build
without any indication of anything being wrong, I noticed that the development server was running, after I've shut it down and rannext build
again It compiled successfully.Expected Behavior
Run
next build
to compile the app for production even when I'm running the development server.OR
Notify me that the development server is running and needs to be shut down before running
next build
, that's in case runningnext build
whennext
is running isn't possible.Link to reproduction
https://github.com/YassinEldeeb/Next.js-starter
To Reproduce
next
for the development server.next build
while the development server is running.Note: It's not specific to the repository linked above.
Beta Was this translation helpful? Give feedback.
All reactions