/
githubmirror
/
next.js
Обзор
Документация
Войти
/
githubmirror
/
next.js
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
canary
errors/threw-undefined.mdx
23 строки
577 B
Delba de Oliveira
docs: Migrate error messages to MDX and App Router. (#52038)
05 июл 2023, 16:11
Не верифицирован
05 июл 2023, 16:11
44d1a1c
Код
Авторство
О чём код?
--- title: 'Threw `undefined` / `null`' --- ## Why This Error Occurred Somewhere in your code you `throw` an `undefined` or `null` value. Since this isn't a valid error there isn't a stack trace. We show this error instead to let you know what to look for. ```js filename="pages/index.js" function getData() { let error throw error } function Page() { const error = data?.error || null throw error } ``` ## Possible Ways to Fix It Look in your pages and find where an error could be throwing `undefined` or `null` values and ensure `new Error()` is used instead.