How to show error overlay for Vite runtime errors
12 May 2024 (Updated 12 May 2024)
Create a registerRuntimeErrorListener
function:
Call that function in an entry file (e.g., src/main.tsx
):

Now, try doing something that triggers a runtime error like using a non-existing component named <BackLink />
and you should see the error in your browser:

Sources/links
Tagged:
Vite
Thanks for your comment . Once it's approved, it will appear here.
Leave a comment