Does this error message shows in production
Unanswered
Alligator mississippiensis posted this in #help-forum
![Avatar](https://cdn.discordapp.com/embed/avatars/1.png)
Alligator mississippiensisOP
I'm using a library that causes this error:
"Cannot read properties of undefined"
On dev there is a react popup that shows the error,
will this popup appear on production for users,
or the error will just be written in the dev tools?
"Cannot read properties of undefined"
On dev there is a react popup that shows the error,
will this popup appear on production for users,
or the error will just be written in the dev tools?
5 Replies
![Avatar](https://cdn.discordapp.com/avatars/484037068239142956/44415017de6fed2ccd5d44b4b2051ac0.webp?size=256)
joulev
in prod it will be console.error'd if it was a recoverable client error, or a generic error page if it was not recoverable
![Avatar](https://cdn.discordapp.com/embed/avatars/1.png)
Alligator mississippiensisOP
Sorry for my misunderstanding, but what recoverable means?
![Avatar](https://cdn.discordapp.com/avatars/484037068239142956/44415017de6fed2ccd5d44b4b2051ac0.webp?size=256)
joulev
recoverable means the page can still be rendered, i.e. your react component still returns something to be displayed normally. usually this means you throw an error in an event handler or
irrecoverable means you throw during the component rendering so react cannot render the component anymore, example:
useEffect
รขโฌโ it affects the event handling but not the component itselfirrecoverable means you throw during the component rendering so react cannot render the component anymore, example:
function Component() {
const [isErrored, setIsErrored] = useState(false);
if (isErrored) throw new Error();
return <button onClick={() => setIsErrored(true)}>Click me</button>;
}
"Cannot read properties of undefined" can be thrown during server/client component rendering (irrecoverable) or during event handlers/useEffect (recoverable)
![Avatar](https://cdn.discordapp.com/embed/avatars/1.png)
Alligator mississippiensisOP
I see, i'll try to look more into this topic, thank you!