Skip to content

Regression with types after Attachments #15924

@huntabyte

Description

@huntabyte

Describe the bug

When using HTMLAttributes<HTMLElement> as the props type for a component, where children is optional, if you don't provide children explicitly, by putting content within the components children or setting children={undefined} you get a type error.

Image

It seems to occur specifically when Partial<> is used.

Reproduction

https://github.com/huntabyte/attachments-type-issue

Go to lib/another.svelte to see the behavior.

Logs

System Info

System:
    OS: macOS 15.2
    CPU: (12) arm64 Apple M2 Max
    Memory: 143.69 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.18.0 - ~/.nvm/versions/node/v20.18.0/bin/node
    npm: 10.8.2 - ~/.nvm/versions/node/v20.18.0/bin/npm
    pnpm: 9.14.4 - ~/Library/pnpm/pnpm
    bun: 1.0.25 - ~/.bun/bin/bun
  Browsers:
    Edge: 136.0.3240.64
    Safari: 18.2
  npmPackages:
    svelte: ^5.0.0 => 5.30.1

Severity

blocking an upgrade

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions