-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Description
Describe the bug
I cannot seem to disable the hydration warning.
I have tried:
<!-- svelte-ignore hydration_html_changed hydration_mismatch -->before the problematic line.
Also the compile option:
compilerOptions: {
warningFilter: (warning) => warning.code !== 'hydration_mismatch'
}And no avail.
This says I should be able to use svelte-ignore.
https://svelte.dev/docs/svelte/runtime-warnings#Client-warnings-hydration_html_changed
Reproduction
My basic repo example uses the hydration_mismatch error, but it also seems to be a problem with hydration_html_changed.
https://github.com/jdgamble555/svelte-hydration-error/blob/master/src/routes/%2Blayout.svelte
I can't post a REPL since it doesn't support TS nor SvelteKit. However, here is SvelteLab:
https://github.com/jdgamble555/svelte-hydration-error
https://www.sveltelab.dev/xk6xs8394ns4ox5?files=.%2Fsrc%2Froutes%2F%2Blayout.svelte
You can't really see anything until you inspect the console.
Related to:
svecosystem/mode-watcher#99
svecosystem/mode-watcher#95
Logs
+layout.svelte:6 [svelte] hydration_mismatchHydration failed because the initial UI does not match what was rendered on the serverhttps://svelte.dev/e/hydration_mismatchSystem Info
New SvelteKit Project.Severity
annoyance