Skip to content

Cloudflare's Email Address Obfuscation may cause crashing on hydration #14761

Open
@7nik

Description

@7nik

Describe the bug

Cloudflare's Email Address Obfuscation feature replaces emails in text with something like

<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="205744534b4d54474d48601112160e434f4d">[email&nbsp;protected]</a>

and then restores before SvelteKit hydration. If there is a text before and/or after the email, it results in multiple text nodes in a row, while only one is expected.

Example of such malformed DOM:
image

Reproduction

Found on not mine site on a personal page.

Logs

Uncaught (in promise) DOMException: Node.appendChild: Cannot add children to a Text

System Info

Svelte 5

Severity

annoyance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions