Open shinokada opened 3 weeks ago
If you check what the server gives away, you'll see that both _main_h1_
are replaced. But, at hydration, it gets fixed to match the component template. You can also see it by adding export const csr = false;
to the +page.js
. Not sure why only the class gets fixed.
Such use of transformPageChunk
doesn't seem to be correct, or at least good, because it causes a hydration mismatch, and such substitution cannot be done for pages rendered on the client.
Describe the bug
I have the following hooks.server.ts. It replaces all words starting and ending with underbar,
_
with 'world'.It works for all the texts but it doesn't work for class.
+page.svelte
Output:
If it is intended so, how can I apply
replaceAll()
toclass
names?Reproduction
I create a simple stackblitz.
https://stackblitz.com/edit/sveltejs-kit-template-default-3msgtk?file=src%2Froutes%2F%2Bpage.svelte
Logs
No response
System Info
Severity
annoyance