Unverified Commit ad5c7367 authored by Jan Potoms's avatar Jan Potoms Committed by GitHub

Remove unused error (#15748)

Irrelevant since https://github.com/vercel/next.js/pull/15379
parent b3c97374
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
#### Why This Error Occurred #### Why This Error Occurred
When using the browser back button the popstate event is triggered. Next.js sets When using the browser back button the popstate event is triggered. Next.js sees a
`popstate` event triggered but `event.state` did not have `url` or `as`, causing a route change failure `popstate` event being triggered but `event.state` did not have `url` or `as`, causing a route change failure.
#### Possible Ways to Fix It #### Possible Ways to Fix It
The only known cause of this issue is manually manipulating `window.history` instead of using `next/router` The only known cause of this issue is manually manipulating `window.history` instead of using `next/router`. Starting from version 9.5, Next.js will ignore `popstate` events that contain `event.state` not created by its own router.
### Useful Links ### Useful Links
......
...@@ -360,13 +360,6 @@ export default class Router implements BaseRouter { ...@@ -360,13 +360,6 @@ export default class Router implements BaseRouter {
return return
} }
if (process.env.NODE_ENV !== 'production') {
if (typeof url === 'undefined' || typeof as === 'undefined') {
console.warn(
'`popstate` event triggered but `event.state` did not have `url` or `as` https://err.sh/vercel/next.js/popstate-state-empty'
)
}
}
this.change('replaceState', url, as, options) this.change('replaceState', url, as, options)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment