Production mode pushRoute issue
See original GitHub issueI am really stumped. When certain conditions exist, Router.pushRoute
runs without doing anything, without any console errors appearing.
All of these are conditions must be met to see the issue:
- Running a Next.js build in
production
mode. Dev mod is fine in all browsers. - Cache must be cleared. If you have visited the page you are trying to route to, it will work.
- Firefox or Safari. Chrome is fine.
- For Safari, an additional condition is required: It must be a deployed live site (I’m using Now), all the above conditions work locally.
I am using pushRoute
via fridays/next-routes inside an Apollo mutation callback. I have console logged everything ok up until the Next.js router is meant to do it’s thing here. I am pretty confused how to debug from there.
If you manually click a link to the same route in the site nav because you are sick of waiting, it transitions fine.
Seen in 3.0.0-beta10
and 3.0.0-beta11
.
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (7 by maintainers)
Top Results From Across the Web
Production mode pushRoute issue · Issue #2195 · vercel/next.js
I am really stumped. When certain conditions exist, Router.pushRoute runs without doing anything, without any console errors appearing.
Read more >Parameter routing and condition dont work on production mode
The problem starts when I publish on production, the URL I tried is: myapp.company.com/scenario/?utm_source=kiosk it just return 404 - file ...
Read more >next/router | Next.js
This is a production only feature. Next.js doesn't prefetch pages in development. router.prefetch(url, as ...
Read more >Reference Manual For OpenVPN 2.4
OpenVPN 2.0 introduces a new mode ("server") which implements a multi-client server ... This article outlines some of problems with tunneling IP over...
Read more >[Solved]-How to push to netlify in production mode [Nuxt JS]-Vue.js
As it looks you need to tweak your deployment command. Go to Netlify and try changing it to npm install; npm run build...
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 Free
Top 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
@jaydenseric I’ve been having a similar issue which I believe is caused by the same bug. In production if I click a link (created with
<Link prefetch>
) right after the page loadsRouteChangeStart
will fire and then nothing happens. The next time I click a linkonRouteChangeError
fires, just like you describe. Because this is intermittent my guess is that it’s only happening if the prefetch has not yet completed before the link is clicked.Further clues.
Ruled out it having anything to do with query batching.
Interestingly, when replacing:
With:
It works. Something silently breaks within the imperative Router API.