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:
Application error: a client-side exception has occurred while loading ...
and the console shows:
Rendered more hooks than during the previous render.
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:
- Remove
redirect("/dashboard") on the Home page and render some HTML instead.
- Replace
<Suspense> with a <div> in SignedInLayout.
- Don't call the
getAuth() server action in Providers.
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/AWhich 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.