Skip to content

Binding to an exported constant while passing $$restProps fails #13844

@sockmaster27

Description

@sockmaster27

Describe the bug

Running the Svelte 5 compiler on the program linked in the reproduction fails with the error can't overwrite accessor property "x".
This is annoying since it worked in Svelte 4, and it's hard to pinpoint the cause of this error when doing an incremental adoption of the new syntax.

Reproduction

https://svelte.dev/playground/f3fedf8d01d54d21bdaa924417649d5b?version=5.0.5

Logs

No response

System Info

System:
    OS: Windows 11 10.0.22631
    CPU: (16) x64 AMD Ryzen 7 2700X Eight-Core Processor
    Memory: 5.18 GB / 15.92 GB
  Binaries:
    Node: 20.16.0 - C:\Program Files\nodejs\node.EXE
    npm: 10.9.0 - C:\Program Files\nodejs\npm.CMD
    bun: 1.1.12 - ~\.bun\bin\bun.EXE
  Browsers:
    Chrome: 130.0.6723.59
    Edge: Chromium (123.0.2420.97)
    Internet Explorer: 11.0.22621.3527

Severity

annoyance

Metadata

Metadata

Assignees

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