#49 most commonruntime/UILovableBolt.newCursorv0Windsurf

Invalid hook call / Rendered more hooks than during the previous render

Invalid hook call. Hooks can only be called inside of the body of a function component. / Rendered more hooks than during the previous render.

Got a slightly different error? Paste the exact message and get a fix prompt tailored to it.

Paste your error →

What it means

React has strict rules about where special functions called 'hooks' (useState, useEffect, etc.) can be used. One of them is being used in the wrong place, like inside an if-statement, or two copies of React got installed.

How to fix it: paste this prompt into your AI builder

Fix prompt for Lovable, Bolt, Cursor, v0, Windsurf
My app shows an "Invalid hook call" / "Rendered more hooks" error. Check the component in the stack trace: make sure every hook (useState, useEffect, useQuery, custom useX) is called at the top level of a function component, never inside if-statements, loops, callbacks, or after an early return. Also check package.json for duplicate or mismatched react / react-dom versions. Make the minimal fix and leave unrelated code alone.

If the AI can't fix it: manual steps

  1. If it started after installing a package, check that react and react-dom have the same version in package.json.

Where this happens

Seen in these AI app builders and editors:

LovableBolt.newCursorv0Windsurf

Sources

Related runtime/UI errors

Still stuck? Paste your full error and UnstuckMyVibe will match it and hand you the exact fix prompt.

Fix my error →