← All fixes
next build fails prerendering a page that queries the database
#4Error
Error occurred prerendering page "/leaderboard". Error: DATABASE_URL is not set. Export encountered an error, exiting the build.
Fix
Next.js tries to statically render pages at build time, and the build has no database env vars (or you don't want build-time data). Mark the page dynamic: export const dynamic = "force-dynamic"; at the top of the page file. Alternatively make the env var available to the build environment, but per-request rendering is usually what a DB-backed page wants.
Did it work?
No reports yet0 worked0 didn't
Tried it yourself?
Related fixes
Tailwind styles work in dev but are missing in production build
#5Some Tailwind classes have no effect after npm run build / deploy, though they work with the dev server.
create-next-app fails: name can no longer contain capital letters
#8Could not create a project called "MyApp" because of npm naming restrictions: name can no longer contain capital letters
Next.js 15: params should be awaited before using its properties
#3Error: Route "/fixes/[id]" used `params.id`. `params` should be awaited before using its properties.