Error when using enhanced:img
(CSR and inside div
)
#14279
Labels
awaiting submitter
needs a reproduction, or clarification
enhanced:img
(CSR and inside div
)
#14279
Describe the bug
I have a page that uses
<enhanced:img>
, it is built usingadapter-static
.build
andcheck
report no error, but when accessing the site I get this weird client runtime error:When disabling CSR, it does not error (no client side code.. of course)...
When putting the img in the root of the file, it does not error (weird...), however a
hydration_mismatch
warning is logged to the console anyway (should this be?)Reproduction
https://github.com/timephy/svelte-5-weird-runtime-error
This page errors, it is using CSR and
<enhanced:img>
is inside a<div>
.https://timephy.github.io/svelte-5-weird-runtime-error
This page does not error, CSR is disabled.
https://timephy.github.io/svelte-5-weird-runtime-error/working_no_csr
This page does not error,
⚠️ However I get a
<enhanced:img>
is in the root of the file.https://timephy.github.io/svelte-5-weird-runtime-error/working_root_img
hydration_mismatch
warning!Logs
No response
System Info
System: OS: macOS 15.1 CPU: (20) x64 Intel(R) Xeon(R) W-2150B CPU @ 3.00GHz Memory: 7.96 GB / 64.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 23.1.0 - /usr/local/bin/node Yarn: 1.22.11 - /usr/local/bin/yarn npm: 10.9.0 - /usr/local/bin/npm pnpm: 9.12.3 - /usr/local/bin/pnpm bun: 1.0.25 - /usr/local/bin/bun Browsers: Chrome: 130.0.6723.117 Safari: 18.1 npmPackages: svelte: ^5.1.15 => 5.1.15
Note
❗❗❗ All of this only happens on
build > preview
and not duringdev
!Severity
blocking all usage of svelte
The text was updated successfully, but these errors were encountered: