Via sveltejs/v2.svelte.dev#216
As of Svelte 1.57.0 we are using classes to scope styles instead of attributes, and SVG DOM elements do not implement a className setter, so trying to set that throws an exception. Classes are allowed on SVG elements, but they can't be programmatically set that way.
I see that when classes are used on SVG elements normally, the generated code uses setAttribute, and so we should probably make sure we use that for CSS scope classes as well.
I'm not sure why this didn't show up in unit tests. Either there aren't any unit tests have scoped CSS and SVG or (more worrisome) jsdom erroneously supports .className setting on SVG elements.
Via sveltejs/v2.svelte.dev#216
As of Svelte 1.57.0 we are using classes to scope styles instead of attributes, and SVG DOM elements do not implement a
classNamesetter, so trying to set that throws an exception. Classes are allowed on SVG elements, but they can't be programmatically set that way.I see that when classes are used on SVG elements normally, the generated code uses
setAttribute, and so we should probably make sure we use that for CSS scope classes as well.I'm not sure why this didn't show up in unit tests. Either there aren't any unit tests have scoped CSS and SVG or (more worrisome) jsdom erroneously supports .className setting on SVG elements.