Replies: 1 comment 2 replies
-
Not sure whether it makes any difference in your scenario, but to deactivate hydration for a page, you must use <script context="module">
export const hydrate = false;
</script> |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a SvelteKit app with the following route at
hello.svelte
:I compile this app using the static adapter and deploy it using a webserver in Rust, which replaces
[[ name ]]
dynamically with a string such asfoobar
, so the output becomeshello foobar world
.Since
hydrate = false
, I would expect this content to not be overwritten by Sveltekit, but during the call toinitialize
instart.js
, the content is overwritten by[[ name ]]
again.This issue can be simulated if you run a SvelteKit app in
dev
mode, set a breakpoint onconst file = "src/routes/hello.svelte";
inhello.svelte
and replace the div content withhello foobar world
. When you continue script execution, the div content is ultimately replaced byhello [[ name ]] world
again.I have a workaround which looks like this:
This works, however it seems hacky. Is there another way to do this?
Beta Was this translation helpful? Give feedback.
All reactions