silverwolf-x/project / errors /threw-undefined.mdx
silverwolf-x's picture
download
raw
577 Bytes
---
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.

Xet Storage Details

Size:
577 Bytes
·
Xet hash:
0c2aab4c5c108f0e956ecd1a145b34df5aa259ea8b5f89c7f0f2db947c2afd45

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.