Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Next Build hangs forever

I'm building an app with NextJs and Typescript. I'm trying to run next build (yarn build) on my local machine to check for typescript warnings and build errors before deploying.

Next build hangs at 'Creating an optimized production build' and hangs forever. Don't even know where to start to address this issue. Can anyone help with this?

like image 576
Dayvvo Avatar asked Sep 10 '25 18:09

Dayvvo


2 Answers

Could be a cache issue.

I'd start by removing /.next folder, if it didn't work then both /.next and /node_modules. Whenever you have issues with Next you don't know how to approach or it's just acting weird - removing /.next will solve most of the problems.

like image 139
EcksDy Avatar answered Sep 12 '25 11:09

EcksDy


Have found the solution to the issue. Apparently the build freeze was caused by empty files located all over my project directory. Removed all of them and next build runs

like image 39
Dayvvo Avatar answered Sep 12 '25 09:09

Dayvvo