Skip to content

[Svelte 5] No more "Attributes need to be unique" error on duplicate class:name and style:property directives #13095

Closed
@adiguba

Description

@adiguba

Describe the bug

I don't know if it's intentional or not, but there is no longer an error message in case of duplicate directives for class:name and style:property.

Ex:

<button
	style:border={border}
	style:border="1px solid red"
>
	button
</button>

On Svelte 4, this code will produce a compile error "Attributes need to be unique".
This is no longer the case with Svelte 5, (runes enabled or not)

Reproduction

Svelte 4 (OK) : https://svelte.dev/repl/09eaa85fa6b842959418bbcc9c0d1cf2?version=4.2.19

Svelte 5, non-runes mode : https://svelte-5-preview.vercel.app/#H4sIAAAAAAAACnVQwWrDMAz9FaFLoQzCrm5c6HfMO6SxOgxObCRlpA3598Y1pbBRdJCe9HhP0oKXEEnQfC04dgOhwVPO-IF6zQXIL0WlDUuauC-dVnoOWY9udEpzTqwQSUHCjQ7Q7GEgH6YBEkPs-Idg3_xhnhN74oMb2-YltUV7nlRTKbWPnYipSnYp0tbaXcW79T3j4VgJotdIpnrZpeb_A4efeQZJMXhg8g4L43Hac5m2qdVx-8GQfLgE8miUJ1q_1ztxzxAlPgEAAA==

Svelte 5, runes mode : https://svelte-5-preview.vercel.app/#H4sIAAAAAAAACnVPywrCMBD8lbAIKgjFa2wEv8N4aJutBNImZLeihv67jUE8iOxhZ2ZnXwl665BAnhOMzYAg4RQC7IAfIRO6oWNcOPkpdlmpqYs28FGPmh2ySBloJvvEnWh9NBizMgslViH6QJvtQY919W1bom4nZp8hd64hkgMaOw0q5TFKqXXh6_m_wzXxisVA_HAoy26VSv4taNiHuyDvrBERjYbseL_xOaauCjou_w7e2N6iAclxwvkyvwAgiWkEKgEAAA==

Logs

No response

System Info

REPL

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