Next.js dev server returns 500 errors when builds share the .next folder
A developer's Next.js dev server began returning 500 errors on every page, citing a missing Google font module in Turbopack. Network checks showed the font servers were fine, and the real cause was running next build while next dev was active. Both commands wrote to the same .next directory, which grew to 281 MB of mixed artifacts and lost Turbopack's font import table. Clearing the folder fixed the problem, but the lasting fix was giving each task its own output directory via a configurable distDir. The dev script, the regular build, and verification builds now each use a separate folder, and those folders are added to .gitignore.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in