2023-07-05 15:11:16 +02:00
---
title: '`popstate` called with empty state'
---
2018-08-24 12:30:27 +02:00
2023-07-05 15:11:16 +02:00
## Why This Error Occurred
2018-08-24 12:30:27 +02:00
2020-07-31 19:29:09 +02:00
When using the browser back button the popstate event is triggered. Next.js sees a
`popstate` event being triggered but `event.state` did not have `url` or `as`, causing a route change failure.
2018-08-24 12:30:27 +02:00
2023-07-05 15:11:16 +02:00
## Possible Ways to Fix It
2018-08-24 12:30:27 +02:00
2020-07-31 19:29:09 +02:00
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.
2018-08-24 12:30:27 +02:00
2023-07-05 15:11:16 +02:00
## Useful Links
2018-08-24 12:30:27 +02:00
2020-05-27 23:51:11 +02:00
- [The issue this was reported in: #4994](https://github.com/vercel/next.js/issues/4994)