arrow_backBACK TO DRILLS
Blue BeltnextjsPREMIUM
The Storage That Middleware Never Had
This middleware throws immediately on every incoming request.
REACT_MODULE // 0x42
import { NextResponse } from 'next/server';
export function middleware(request) {
const theme = localStorage.getItem('theme');
if (!theme) {
return NextResponse.redirect(new URL('/onboarding', request.url));
}
return NextResponse.next();
}What's the fundamental issue causing the crash?