/
githubmirror
/
next.js
Обзор
Документация
Войти
/
githubmirror
/
next.js
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
canary
errors/popstate-state-empty.mdx
16 строк
643 B
Delba de Oliveira
docs: Migrate error messages to MDX and App Router. (#52038)
05 июл 2023, 16:11
Не верифицирован
05 июл 2023, 16:11
44d1a1c
Код
Авторство
О чём код?
--- title: '`popstate` called with empty state' --- ## Why This Error Occurred 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. ## Possible Ways to Fix It 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 - [The issue this was reported in: #4994](https://github.com/vercel/next.js/issues/4994)