[bug] page destroyed during hydration if a file fails to load #2699
Labels
bug
Something isn't working
help wanted
PRs welcomed. The implementation details are unlikely to cause debate
p2-nice-to-have
SvelteKit cannot be used by a small number of people, quality of life improvements, etc.
Milestone
Describe the bug
The page from the reproduction loads during SSR and then fails during hydration during dev mode if you both have adblock on and are not using the new
experimental.prebundleSvelteLibraries
option (RobBrazier/svelte-awesome#775).This particular example is kind of an edge case, but the outcome is really bad and I'm not so sure how rare it is more generally. Per Rich's point, sometimes things fail to load because you live in NYC and take the subway and lose connectivity going into a tunnel. That the entire page would be wiped out eventhough SSR succeeded is quite a bad outcome. If we wrapped the whole hydration in a
try
/catch
maybe you'd at least see the server-rendered page. Or perhaps if we had error boundaries the developer could do something smarterReproduction
https://github.com/benmccann/500-import-failure
Logs
I get a message in the browser:
Screenshot:
System Info
This fails on
1.0.0-next.138
and newer all the way up tomaster
since that's when we turned oncompilerOptions.hydratable
: #2024https://github.com/sveltejs/kit/blob/master/packages/kit/CHANGELOG.md#100-next138
Severity
blocking all usage of SvelteKit
Additional Information
No response
The text was updated successfully, but these errors were encountered: