Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the Vite error overlay for more errors at dev time #9704

Open
geoffrich opened this issue Apr 18, 2023 · 2 comments · May be fixed by #9733
Open

Use the Vite error overlay for more errors at dev time #9704

geoffrich opened this issue Apr 18, 2023 · 2 comments · May be fixed by #9733
Milestone

Comments

@geoffrich
Copy link
Member

Describe the problem

During development, some runtime errors only show a message in the console. For example, if you cause an error in a load function or during rendering of a component, SvelteKit's error page is displayed and you need to look at the dev console to figure out where the error is. New users may not realize that they need to look at the console for this.

It would be nice if the error and stack trace was shown on the page as well.

This was called out as accessibility feedback in sveltejs/svelte#8508 (comment), though I think surfacing errors better is more broadly applicable.

Describe the proposed solution

Expose runtime errors via Vite's error overlay, similar to how compilation errors are displayed.

Alternatives considered

Do nothing and expect people to keep looking at the dev console.

Importance

nice to have

Additional Information

I'm unclear whether this depends on vitejs/vite#2076 or not - parts of this may be blocked by Vite.

@dummdidumm
Copy link
Member

On tricky part is that errors on the client also need to get the error overlay treatment. Either we send a web socket message to the server to send one back to open it on the client, or we somehow hack our way into Vite's createErrorOverlay method.

@BYK
Copy link

BYK commented Jul 23, 2024

If anyone is still interested, we did something similar to @dummdidumm's suggestion here: https://spotlightjs.com/setup/vite

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants