Skip to content

xmlns attribute not present in HTMLAttributes type #16079

Closed
@christophsanz

Description

@christophsanz
Contributor

Describe the bug

When using <svelte:element> with an xmlns attribute, we get a type error, even though the attribute should be allowed.

https://www.w3schools.com/xml/xml_namespaces.asp

Reproduction

Create a <svelte:element this="div"> that is not a svg element, and add the xmlns attribute to it and notice the type error.

Logs

System Info

System:
    OS: Windows 11 10.0.22631
    CPU: (12) x64 12th Gen Intel(R) Core(TM) i7-1255U
    Memory: 11.70 GB / 31.58 GB
  Binaries:
    Node: 22.11.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 10.9.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Chromium (127.0.2651.86)
    Internet Explorer: 11.0.22621.1

Severity

annoyance

Activity

added theissue type on Jun 4, 2025
dummdidumm

dummdidumm commented on Jun 4, 2025

@dummdidumm
Member

Should be an easy fix within elements.d.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueA small, encapsulated issue, ideal for a new contributor to Svelte to tackle.types / typescript

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @dummdidumm@christophsanz

      Issue actions

        `xmlns` attribute not present in HTMLAttributes type · Issue #16079 · sveltejs/svelte