/
githubmirror
/
next.js
Обзор
Документация
Войти
/
githubmirror
/
next.js
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
canary
errors/circular-structure.mdx
15 строк
693 B
Delba de Oliveira
docs: Migrate error messages to MDX and App Router. (#52038)
05 июл 2023, 16:11
Не верифицирован
05 июл 2023, 16:11
44d1a1c
Код
Авторство
О чём код?
--- title: 'Circular structure in `getInitialProps` result' --- ## Why This Error Occurred `getInitialProps` is serialized to JSON using `JSON.stringify` and sent to the client side for hydrating the page. However, the result returned from `getInitialProps` can't be serialized when it has a circular structure. ## Possible Ways to Fix It Circular structures are not supported, so the way to fix this error is removing the circular structure from the object that is returned from `getInitialProps`. For example, the `req` instance exposed is a circular object and can not be serialized, instead the specific fields such as relevant headers on the instance should be passed specifically.