sveltejs / sveltejs/kit

Mobile Safari hydration mismatch due to icon

Open
#13,506 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
20.8k
Forks
2.3k
Avg merge
1d 16h
Merged PRs (30d)
156

Description

Describe the bug

I get the hydration mismatch warning when putting an svg (lucide icon) there. but only on ios/ipados safari. newest version.
All other browsers including desktop safari do not have this issue.

In a real project i have lucide icons everywhere and never had issues but in that specific context it did create that mismatch.

If theres nothing svelte can do, is it possible to warn just like self-closing tags?

Minimal repo: https://github.com/Sillyvan/mobile-safari-hydration-mismatch

Reproduction

https://mobile-safari-hydration-mismatch.silvan-gehrig.workers.dev/

Logs
https://svelte.dev/e/hydration_mismatch
System Info
System:
    OS: Linux 5.15 Ubuntu 24.04.1 LTS 24.04.1 LTS (Noble Numbat)
    CPU: (16) x64 AMD Ryzen 7 7800X3D 8-Core Processor
    Memory: 12.79 GB / 15.20 GB
    Container: Yes
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.14.0 - /usr/bin/node
    Yarn: 1.22.22 - /usr/bin/yarn
    npm: 10.7.0 - /usr/bin/npm
    bun: 1.1.43 - ~/.bun/bin/bun
  npmPackages:
    @sveltejs/adapter-auto: ^4.0.0 => 4.0.0
    @sveltejs/adapter-cloudflare: ^5.0.3 => 5.0.3
    @sveltejs/kit: ^2.16.0 => 2.17.3
    @sveltejs/vite-plugin-svelte: ^5.0.0 => 5.0.3
    svelte: ^5.0.0 => 5.20.4
    vite: ^6.0.0 => 6.2.0
Severity

serious, but I can work around it

Additional Information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the minimal repository at https://github.com/Sillyvan/mobile-safari-hydration-mismatch and reproduce the warning using the linked reproduction page on iOS or iPadOS Safari. Read the Svelte hydration_mismatch documentation linked in the logs and compare the SVG/icon behavior with other browsers. Done means the Safari-specific mismatch is explained and fixed, or the issue is documented as an unavoidable browser limitation with an appropriate warning path.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.