[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"problem-detail-warning-next-js-app-restarts-because-its-production-build":3},{"stack":4,"error":5,"seoName":6,"seoStack":7,"seo":8,"breadcrumb":10,"titlePrefix":17,"titleAccent":18,"lead":19,"facts":22,"why":37,"log":50,"fix":79,"engine":103,"related":114,"pitch":134},"nextjs","next-js-app-restarts-because-its-production-build","Next.js app restarts because its production build is missing","Nextjs",{"description":9},"The application started but did not answer on any port it publishes. The deploy log has the per-port result; a worker or queue-only app can ignore this. | The a",[11,14,16],{"label":12,"href":13},"App Installations","\u002Fapps",{"label":7,"href":15},"\u002Fapps\u002Fstacks\u002Fnextjs",{"label":6},"Next.js app restarts because ","its production build is missing",[20],{"text":21},"The application started but did not answer on any port it publishes. The deploy log has the per-port result; a worker or queue-only app can ignore this. | The application is restarting, not running. Docker reports app (Restarting (1) 17 seconds ago). Nothing answered on any published port because the process keeps exiting. Read the container output with container_service_logs; the reason it exits is there.",[23,28,31,33],{"label":24,"value":25,"tone":26,"tooltip":27},"Type","Warning","warn","An issue PanelAlpha Engine catches around a deploy that does not break it. It tells you, before or after, that you may need to do something.",{"label":29,"value":30},"Seen","5 times",{"label":32,"value":7},"Where",{"label":34,"value":35,"tooltip":36},"Status","Observed","Our team will look into this soon, verify the cause and try to fix it in an upcoming release.",{"heading":38,"body":39},"Why it happens",[40,42,45,47,48],{"text":41},"The container starts Next.js on port 3000, but no production build is present in the ",{"text":43,"code":44},".next",true,{"text":46}," directory. The process exits immediately and Docker restarts it, so the health check cannot connect. This can happen when the build runs in a different workspace or the ",{"text":43,"code":44},{"text":49}," output is not included in the runtime container.",{"heading":51,"block":52},"What the log looks like",{"header":53,"lines":54},"Deploy log",[55,59,63,67,71,75],{"segments":56},[57],{"text":58},"Health check: http:\u002F\u002F[ip]:3000\u002F did not answer — Failed to connect to [ip] port 3000",{"segments":60},[61],{"text":62},"app-1  | ✓ Ready in 157ms",{"segments":64},[65],{"text":66},"app-1  | Error: Could not find a production build in the '.next' directory. Try building your app with 'next build' before starting the production server.",{"segments":68},[69],{"text":70},"app-1  | [panelalpha] start: serve",{"segments":72},[73],{"text":74},"app-1  | Error: Could not find a production build in the '.next' directory.",{"segments":76},[77],{"text":78},"app-1  | Docker reports app (Restarting (1) 7 seconds ago).",{"heading":80,"steps":81,"block":100},"How to fix it",[82],[83,85,87,89,91,93,95,97,98],{"text":84},"Review the build and start commands in ",{"text":86,"code":44},"package.json",{"text":88}," and the repository workspace configuration. Ensure the deployment runs ",{"text":90,"code":44},"next build",{"text":92}," for the app being started, then starts it with ",{"text":94,"code":44},"next start",{"text":96},". For a monorepo, build from the correct package directory and copy or retain that package’s ",{"text":43,"code":44},{"text":99}," directory in the runtime image. Redeploy and confirm the container remains running on port 3000.",{"header":101,"lines":102},"Fix by hand",[],{"heading":104,"body":105,"block":111},"How PanelAlpha Engine solves it",[106,108,109],{"text":107},"Detect the missing ",{"text":43,"code":44},{"text":110}," production artifact before starting the container, and report the build package or workspace that produced it. For monorepos, preserve the selected app’s build output and working directory when assembling the runtime container.",{"header":112,"lines":113},"",[],{"heading":115,"items":116},"Apps affected",[117,122,125,128,131],{"title":118,"badge":119,"tone":120,"href":121},"Hexclave","1 occurrence","err","\u002Fapps\u002Fhexclave\u002Fhexclave",{"title":123,"badge":119,"tone":120,"href":124},"Oriveo","\u002Fapps\u002Foriveo\u002Foriveo",{"title":126,"badge":119,"tone":120,"href":127},"jsoncrack-monorepo","\u002Fapps\u002Faykutsarac\u002Fjsoncrack.com",{"title":129,"badge":119,"tone":120,"href":130},"openanalytics","\u002Fapps\u002Fopenlabs-so\u002Fopenanalytics",{"title":132,"badge":119,"tone":120,"href":133},"tasktrove","\u002Fapps\u002Fdohsimpson\u002Ftasktrove",{"heading":135,"body":136,"footNote":137,"docsLabel":138,"docsHref":139},"Try PanelAlpha Engine yourself.","The easiest way to turn your server into a safe, controlled environment for your AI agent. Deploy, manage and maintain any project from Claude Code, Cursor, Codex or any other MCP client. Open source under Apache 2.0, free to run.","Requires Ubuntu 24.04 or 26.04 · 2 GB RAM · 1 CPU","Read the documentation","https:\u002F\u002Fpanelalpha.com\u002Fdocs"]