You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<!DOCTYPEhtml><htmllang="en"><head><metacharset="utf-8"/><linkrel="icon"href="%PUBLIC_URL%/favicon.ico"/><metaname="viewport"content="width=device-width, initial-scale=1"/><title>MY APP</title></head><body><noscript>You need to enable JavaScript to run this app.</noscript><divid="root"></div></body></html>
and use the following function to throw the error:
When I throw the error in the loader the error element is rendered as expected. However when I throw it in the element Uncaught runtime error overlay is rendered and when I close it there is just a blank screen underneath. Why is that? And how can I fix it? I have also tried to include the errorElement in each route but it does not seem to have an effect.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
When using react-router 6.18 the top level errorElement is not rendered on error. I define my routes like this:
Routes.tsx
index.tsx
index.html
and use the following function to throw the error:
When I throw the error in the loader the error element is rendered as expected. However when I throw it in the element Uncaught runtime error overlay is rendered and when I close it there is just a blank screen underneath. Why is that? And how can I fix it? I have also tried to include the errorElement in each route but it does not seem to have an effect.
Here is the whole error message:
Console output:
EDIT
When I wrap the error in a component:
the errorElement is now rendered but the "uncaught runtime error" overlay still remains. How can I get rid of it?
Beta Was this translation helpful? Give feedback.
All reactions