Skip to content

Using a type matching the component name causes it to be overridden #2865

@x0k

Description

@x0k

Describe the bug

When defining a type Foo inside foo.svelte, it gets overridden by the generated component type with the same name.

Reproduction

StackBlitz

Logs

System Info

System:
    OS: Linux 6.12 cpe:/o:nixos:nixos:25.05 25.05 (Warbler)
    CPU: (12) x64 Intel(R) Core(TM) i5-10400F CPU @ 2.90GHz
    Memory: 1.93 GB / 15.56 GB
    Container: Yes
    Shell: 5.2.37 - /run/current-system/sw/bin/bash
  Binaries:
    Node: 24.7.0 - /nix/store/ffx0ixqnd6arwnjqmjv844krhay4iycj-nodejs-24.7.0/bin/node
    npm: 11.5.1 - /nix/store/ffx0ixqnd6arwnjqmjv844krhay4iycj-nodejs-24.7.0/bin/npm
    pnpm: 10.15.1 - /nix/store/dmnyvw4gf3i8b65s3k7q4ws3257m6zrs-pnpm-10.15.1/bin/pnpm
  Browsers:
    Brave Browser: 140.1.82.170
  npmPackages:
    svelte: catalog: => 5.39.11

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