</>CodeWithKarani
All topics
Topic

Web & JavaScript

Next.js, React, Node and TypeScript - the errors, the caching model, and shipping fast front ends that actually work in production.

Sub-topics

41 articles · showing 1-9 (page 1 of 5)

Security9 min read

CSP 'unsafe-inline' Is Not a Fix: Nonces That Work in Next.js

Adding 'unsafe-inline' to silence CSP violations turns the header into compliance theatre. Here is the per-request nonce setup for Next.js that keeps hydration working.

Read
Web & JavaScript9 min read

ERR_REQUIRE_ESM on Vercel but not locally: the Next.js 16.2 monorepo bug

Your Next.js build passes and the Vercel deploy 500s with ERR_REQUIRE_ESM. Here is the missing .next/package.json that causes it, and three workarounds that hold.

Read
Security9 min read

Storing JWTs in localStorage Turns Any XSS Into Account Takeover

Every JWT tutorial puts the token in localStorage. Here is what that costs when XSS lands, and the in-memory access token plus HttpOnly refresh cookie setup that replaces it.

Read
Web & JavaScript10 min read

Decoding minified React error #418, #423 and #425 in Next.js production

Production React ships numbers instead of messages. Here is the decoder, what each hydration code actually says, and why you can reproduce all of it locally.

Read
Web & JavaScript9 min read

Why next dev keeps eating memory, and what actually helps

The Next.js dev server climbing to an out-of-memory crash is not one bug with one fix. Here is how to find which of the four layers is growing, and the mitigations that work today.

Read
Web & JavaScript9 min read

JavaScript Heap Out of Memory on next build: Find the Real Cause

Raising --max-old-space-size hides the problem instead of fixing it. Three different build phases can exhaust the heap, and the last log line tells you which one you have.

Read
Security9 min read

Users Randomly Logged Out: Fixing next-auth Token Rotation

Auth.js refresh token rotation silently drops the rotated token in four distinct ways, and the popular workaround of disabling rotation is worse than the bug. Here is the real fix.

Read
Web & JavaScript10 min read

Next.js Hydration Failed: Find the Real Mismatch, Not the Suppress Flag

Hydration failed and the overlay will not say which element. Here is the diff technique that finds it, the five real causes, and why suppressHydrationWarning is not a fix.

Read
Web & JavaScript8 min read

Dynamic Code Evaluation Not Allowed in Edge Runtime: The Next.js Middleware Fix

Mongoose and jsonwebtoken break Next.js middleware with a dynamic code evaluation error that names no package. Here is the real cause and the fix for each version.

Read
Web & JavaScript - Guides, Sub-topics & Fixes · Code With Karani