Skip to content
About

Fixed: Every Page Was Crashing in Dev Mode

A quirk in how Next.js handles URL objects was crashing every page locally during development. Eight lines changed, very annoying bug.

1 min readEvergreen8:19amMiami Beach, FL, USA
On this page

Every time I opened the blog locally to work on it, every page crashed. Nothing wrong on the live site — this only happened on my computer, in development mode. But still.

What happened

The framework does a behind-the-scenes process each time a page loads locally. Part of that process copies some page settings — including the site's URL. There's a quirk: if the URL is stored as a special URL object instead of a plain text string, the copy process chokes on it.

The fix was simple: use a plain text string for the URL. Same result, no crash.

Eight lines changed. The hour and a half I spent before that adding debug logging to figure out which setting was causing it — that doesn't count.


PR: https://github.com/StevieIsmagic/vercel_blog/pull/20

Related posts

Stay in the loop

Newsletter launching soon — follow along via RSS.