-
Notifications
You must be signed in to change notification settings - Fork 28.3k
Minified React error #310: Rendered more hooks than during the previous render. #78396
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Also getting this with PPR enabled when reaching a 404 page. Root Cause of the IssueRouter component's conditional logic, triggered by an unknown page, alters hook execution, violating React's Rules of Hooks during re-render. User navigates to unknown page, initiating a page load and triggering the Next.js routing system, which is the entry point for rendering the requested documentation page.The user's navigation action triggers Next.js's page rendering process, starting with the The
|
Also encounter this issue in next 15.1.3 |
I can see this error on next.js 15.3.1 |
@wlcharlie @himself65 @moroshko |
Running into this issue as well on Though, while the layout client component is fetching its data a redirect happens, and causes this error. GET /one 200 in 78ms
~Root layout client component calls action to fetch data
~Page level (page one) server component performs redirect based on some condition
GET /two 200 in 61ms
~Server action starting on server (sent from root layout)
~Resolving data from server action
POST /one 200 in 92ms
GET /two 200 in 37ms
~Server action starting on server
~Resolving from server action
POST /two 200 in 72ms Next Info:Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 24.4.0: Fri Apr 11 18:33:40 PDT 2025; root:xnu-11417.101.15~117/RELEASE_ARM64_T6031
Available memory (MB): 36864
Available CPU cores: 14
Binaries:
Node: 22.14.0
npm: 10.9.2
Yarn: 1.22.22
pnpm: 9.15.5
Relevant Packages:
next: 15.2.1 // There is a newer version (15.3.1) available, upgrade recommended!
eslint-config-next: 15.2.1
react: 19.0.0
react-dom: 19.0.0
typescript: 5.4.5
Next.js Config:
output: N/A |
Link to the code that reproduces this issue
https://github.com/moroshko/rendered-more-hooks-issue
To Reproduce
Once the application is started in Dev mode, and http://localhost:3000 is visited, the following error appears:
and the console shows:
Then, the error magically disappears and the page is rendered as expected.
Visit here to experience this yourself.
Current vs. Expected behavior
There should be no error.
Provide environment information
Operating System: Platform: darwin Arch: x64 Version: Darwin Kernel Version 24.4.0: Wed Mar 19 21:16:31 PDT 2025; root:xnu-11417.101.15~1/RELEASE_X86_64 Available memory (MB): 16384 Available CPU cores: 12 Binaries: Node: 22.11.0 npm: 10.8.1 Yarn: 1.22.22 pnpm: 9.14.2 Relevant Packages: next: 15.4.0-canary.2 // Latest available version is detected (15.4.0-canary.2). eslint-config-next: N/A react: 19.1.0 react-dom: 19.1.0 typescript: 5.8.3 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
Redirects, Server Actions
Which stage(s) are affected? (Select all that apply)
Vercel (Deployed)
Additional context
If I do any of the following, the issue is gone:
redirect("/dashboard")
on the Home page and render some HTML instead.<Suspense>
with a<div>
inSignedInLayout
.getAuth()
server action inProviders
.The text was updated successfully, but these errors were encountered: