Skip to content

Exporting snippet in module breaks types if complex type is used #14951

@AndreasHald

Description

@AndreasHald

Describe the bug

If you try to export a snippet from a module, but the snippet uses a complex type (something other than string | number) the code runs but you get a type error

CleanShot 2025-01-08 at 13 25 42@2x

(i'm unsure if this issue should be submitted to language tools, if so i apologize)

Reproduction

https://github.com/21RISK/svelte-5-snippet-type-issue

Logs

No response

System Info

System:
    OS: macOS 15.2
    CPU: (10) arm64 Apple M1 Pro
    Memory: 646.78 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.12.0 - ~/.nvm/versions/node/v22.12.0/bin/node
    npm: 10.9.0 - ~/.nvm/versions/node/v22.12.0/bin/npm
  Browsers:
    Chrome: 131.0.6778.206
    Safari: 18.2
  npmPackages:
    svelte: ^5.0.0 => 5.17.0

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