Does this error message shows in production
Unanswered
Alligator mississippiensis posted this in #help-forum
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
@Alligator mississippiensis 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?
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
@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
Alligator mississippiensisOP
Sorry for my misunderstanding, but what recoverable means?
@Alligator mississippiensis Sorry for my misunderstanding, but what recoverable means?
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)
Alligator mississippiensisOP
I see, i'll try to look more into this topic, thank you!