File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
packages/svelte/src/internal/client/dom/blocks Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -59,12 +59,7 @@ export function head(render_fn) {
5959
6060 try {
6161 block ( ( ) => render_fn ( anchor ) , HEAD_EFFECT ) ;
62- if ( hydrating ) {
63- if ( hydrate_node === null || /** @type {Comment } */ ( hydrate_node ) . data !== HYDRATION_END ) {
64- hydration_mismatch ( ) ;
65- throw HYDRATION_ERROR ;
66- }
67- }
62+ check_end ( ) ;
6863 } catch ( error ) {
6964 // re-mount only this svelte:head
7065 if ( was_hydrating && head_anchor && error === HYDRATION_ERROR ) {
@@ -102,3 +97,11 @@ export function head(render_fn) {
10297 }
10398 }
10499}
100+
101+ // treeshaking of hydrate node fails when this is directly in the try-catch
102+ function check_end ( ) {
103+ if ( hydrating && /** @type {Comment|null } */ ( hydrate_node ) ?. data !== HYDRATION_END ) {
104+ hydration_mismatch ( ) ;
105+ throw HYDRATION_ERROR ;
106+ }
107+ }
You can’t perform that action at this time.
0 commit comments