Cancel Rendering Route Error when Router Push hash
See original GitHub issueVerify canary release
- I verified that the issue exists in Next.js canary release
Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 21.5.0: Tue Apr 26 21:08:37 PDT 2022; root:xnu-8020.121.3~4/RELEASE_ARM64_T6000
Binaries:
Node: 16.15.0
npm: 8.5.5
Yarn: 1.22.19
pnpm: N/A
Relevant packages:
next: 12.1.7-canary.26
react: 18.1.0
react-dom: 18.1.0
What browser are you using? (if relevant)
Google Chrome Version 102.0.5005.61 (Official Build) (arm64)
How are you deploying your application? (if relevant)
Locally and Vercel
Describe the Bug
Similar to https://github.com/vercel/next.js/issues/36830 (fixed by https://github.com/vercel/next.js/pull/36828)
trying to store more information in hash, getting “Cancel rendering route” error when pushing updated hash to router:
Expected Behavior
Pages changes without error.
To Reproduce
git clone https://github.com/michalbundyra/hash-cancel-rendering-route
cd hash-cancel-rendering-route
yarn
yarn dev
- Go to http://localhost:3000/
- Click “to world”
- Error pops!
Issue Analytics
- State:
- Created a year ago
- Reactions:4
- Comments:12 (4 by maintainers)
Top Results From Across the Web
How to fix Next.js error "cancel rendering route"?
I'm trying to link to a div id and I get this error: Error: Cancel rendering route. This seems to be a problem...
Read more >Next.js Error: Cancel rendering route : r/nextjs - Reddit
I'm trying to link to a div id and I get this error: Error: Cancel rendering route This seems to be a problem...
Read more >Shallow Routing - Next.js
Shallow routing allows you to change the URL without running data fetching methods again, that includes getServerSideProps , getStaticProps , and ...
Read more >Understanding Next.js routeChangeStart and router events
For example, routing in Next.js is as easy as creating a set of pages for the app and ... The hashChangeStart and hashChangeComplete...
Read more >errorElement v6.6.1 - React Router
When exceptions are thrown in loaders, actions, or component rendering, instead of the normal render path for your Routes ( <Route element> ),...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Having the same error just by clicking quickly on nav links with hashtag hrefs. Seems that the error is triggered when the hash link is clicked before it fully scrolled up/down to the hash clicked before.
React 18.1 / Next 12.1.6
I’m using this workaround