One Line in My Root Layout Turned 158 Static Pages Into 0
Reading a cookie with cookies() in the Next.js root layout opts every route out of static rendering. What it cost this blog, measured, and how to fix a theme flash without it.
Practical, diagram-first explanations you can read over coffee. 48 posts and counting.
Why ['1', '7', '11'].map(parseInt) returns [1, NaN, 3]: map passes the index as parseInt's radix. Plus the Number('') trap hiding in the obvious fix.
Reading a cookie with cookies() in the Next.js root layout opts every route out of static rendering. What it cost this blog, measured, and how to fix a theme flash without it.
Why JavaScript's sort() compares numbers as strings, why a 'lazy' comparator works in Safari but breaks in Chrome, and the one-line fix.
A bug report, a route map, and three rounds of making it faster — a story about what Big O really measures, why constants win at small n, and why the best algorithm is sometimes deleting the question.
Cross-Origin Resource Sharing in plain language: what blocks your request, what preflight means, and how to fix the errors you'll see in every frontend job.
Two patterns for taming fast events: debounce waits for silence, throttle limits how often. With examples, code, and interview answers.
Get new posts in your inbox
No spam. Unsubscribe any time.
What should I write next?
Stuck on a concept or an interview question? Ask — the best ones become posts.