Skip to content

Cannot redefine property error during module spread as props #17220

@x0k

Description

@x0k

Describe the bug

The following code <Component {...someModule} {foo} /> results in a Cannot redefine property: foo error if the module exports a variable named foo.

Reproduction

SvelteLab

The error does not occur in the Svelte Playground, so it’s likely related to Vite.

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: 2.34 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: 141.1.83.118
  npmPackages:
    svelte: ^5.30.0 => 5.43.14

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