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

Fix client-side load error handling #794

Merged
merged 10 commits into from
Mar 31, 2021
Merged

Fix client-side load error handling #794

merged 10 commits into from
Mar 31, 2021

Conversation

Rich-Harris
Copy link
Member

I don't think there's an issue for this, but it's an annoying bug that has been wrecking productivity. Basically, if an error was encountered in a load function, any props returned from the root layout's load would be unaccounted for when the page hydrates, which triggers the svelte-hmr error overlay (which on a separate note, I think we should get rid of, since it should be covered by Vite's own error handling. cc @rixo, though I'll probably add a separate issue for this in due course).

This PR mostly amends the client-side logic to mirror the server-side logic, with a couple of other bonus fixes for good measure.

@rixo
Copy link

rixo commented Mar 31, 2021

Re HMR overlay: it's a setting to toggle in the Vite plugin. Seen with @dominikg, we're going to disable it. Maybe, at a later time, we'll study more thoroughly and see if it would be worthy / doable to funnel those errors it catches through Vite's own overlay (initial discussions we've had around this subject was rather headed in the opposite direction, not trying to catch errors at all).

@Rich-Harris
Copy link
Member Author

@rixo sounds good

@Rich-Harris Rich-Harris merged commit c0b9873 into master Mar 31, 2021
@Rich-Harris Rich-Harris deleted the error-below-layout branch March 31, 2021 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants