"Rendered more hooks than during previous render" when using router.replace
#63121
Labels
bug
Issue was opened via the bug report template.
router.replace
#63121
Link to the code that reproduces this issue
Link
To Reproduce
<base-url>/versions/v1
Goto Version v2
Current vs. Expected behavior
I expected to be redirected to
<base-url>/versions/v2
but instead a client-side react error is triggered with the following stack traceProvide environment information
Operating System: Platform: linux Arch: x64 Version: #1 SMP PREEMPT_DYNAMIC Sun Aug 6 20:05:33 UTC 2023 Binaries: Node: 20.11.0 npm: 10.2.4 Yarn: 1.22.19 pnpm: 8.15.1 Relevant Packages: next: 14.1.0 eslint-config-next: 14.1.0 react: 18.2.0 react-dom: 18.2.0 typescript: 5.3.3 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
App Router
Which stage(s) are affected? (Select all that apply)
next dev (local), next build (local), next start (local), Vercel (Deployed), Other (Deployed)
Additional context
I tested my reproduction on the following versions:-
13.4.19
14.1.0
The text was updated successfully, but these errors were encountered: