File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
packages/svelte/src/internal/client/dom Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 1
1
/** @import { TemplateNode } from '#client' */
2
2
3
- import { HYDRATION_END , HYDRATION_START , HYDRATION_START_ELSE } from '../../../constants.js' ;
3
+ import {
4
+ HYDRATION_END ,
5
+ HYDRATION_ERROR ,
6
+ HYDRATION_START ,
7
+ HYDRATION_START_ELSE
8
+ } from '../../../constants.js' ;
9
+ import * as w from '../warnings.js' ;
4
10
5
11
/**
6
12
* Use this variable to guard everything related to hydration code so it can be treeshaken out
@@ -28,6 +34,10 @@ export function set_hydrate_node(node) {
28
34
}
29
35
30
36
export function hydrate_next ( ) {
37
+ if ( hydrate_node === null ) {
38
+ w . hydration_mismatch ( ) ;
39
+ throw HYDRATION_ERROR ;
40
+ }
31
41
return ( hydrate_node = /** @type {TemplateNode } */ ( hydrate_node . nextSibling ) ) ;
32
42
}
33
43
Original file line number Diff line number Diff line change 8
8
</ head >
9
9
< body >
10
10
< noscript > You need to enable JavaScript to run this app.</ noscript >
11
- < div id ="root "> <!--ssr-body --> </ div >
11
+ < div id ="root "> <!--[--> Hello <!--] --></ div >
12
12
13
13
< script type ="module ">
14
14
import { mount , hydrate , unmount } from 'svelte' ;
You can’t perform that action at this time.
0 commit comments