Skip to content

SVG render issues within #if blocks #14671

@Kabakuro

Description

@Kabakuro

Describe the bug

Hey there, I'm currently migrating a project to svelte 5 (It's great so far).

One thing I noticed is that if you have SVG elements in an #if and regular HTML in an :else (or another #if), It won't render the SVG elements. It also errors in the example for using getBBox. I'm guessing this is a namespace issue with if/else blocks?

I understand that this works by using #snippet instead but surely this should just work?

Reproduction

https://svelte.dev/playground/dcb13ede27e9438ba6d2a40002ea36b6?version=5.10.1

Logs

No response

System Info

N/A (using the REPL)

Severity

annoyance

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions