Next.js · browser console
Maximum update depth exceeded
Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render.What it means
A component keeps updating its own state in a loop, so React stops it. It's a React error, but agents cause it often when they wire up effects.
Common causes
- setState in a useEffect with no dependency array
- An object or array created during render used as an effect dependency
- onClick={setOpen(true)} instead of onClick={() => setOpen(true)}
How to fix it
- Give the effect a dependency array, and only list values that really change
- Memoize object or array dependencies, or depend on their primitive fields
- Pass a function to event props instead of calling it
Prompt for Cursor or Claude Code
React hit Maximum update depth exceeded. Find the effect or handler that sets state on every render, explain the loop in one sentence, and fix it with correct dependencies or by passing a function instead of calling it.Not quite your error? Paste yours into the free VibeBoot Doctor or browse the Next.js error fixer.
next: skip the next one
Skip the setup. The VibeBoot SaaS Starter gives you auth, Stripe and a database already wired on Next.js 16.4.3, with AGENTS.md and .cursor/rules that keep your agent on the Next.js 16 conventions. $49, one-time.
14-day money-back guarantee · lifetime updates
Other Next.js errors
- useState / useEffect in a Server Component
- Event handlers cannot be passed to Client Component props
- Functions cannot be passed directly to Client Components
- Only plain objects can be passed to Client Components
- "use client" must be placed before other expressions
- export "metadata" from a "use client" page
$ fixed it? get the next one first
New fixes for what AI agents break, by email.
When we add a fix or a Cursor rule for a new Next.js, Auth.js, Prisma or Stripe break, it goes out in the VibeBoot newsletter. Free, occasional, unsubscribe in one click.