Three Next.js rendering bugs that only appeared after deploying to Cloudflare Workers
A developer migrated a Next.js Pages Router app from Vercel to Cloudflare Workers via OpenNext, and smoke tests passed initially. Browser-based Playwright tests against the built bundle revealed three bugs that curl-based checks could not detect. An inline theme script built from a function's toString() output broke because esbuild's keepNames inserted a __name helper missing in the browser, so the developer removed the runtime script entirely. Server-side rendering in UTC caused hydration mismatches (React error #418) for date formatting, which was fixed by pinning formatting to UTC. Finally, the adapter rendered Next's built-in 404 page instead of the custom one on dynamic routes, so tests were adjusted to check status codes and generic copy.
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