Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
sockmaster27 opened this issue Oct 23, 2024 · 2 comments · Fixed by #13849
Closed

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

sockmaster27 opened this issue Oct 23, 2024 · 2 comments · Fixed by #13849
Assignees

Comments

@sockmaster27
Copy link
Contributor

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

@paoloricciuti
Copy link
Member

This is because you are exporting const instead of let...i'm assuming you wanted to export let otherwise this is one of the documented breaking changes

https://svelte.dev/docs/svelte/v5-migration-guide#Breaking-changes-in-runes-mode-Bindings-to-component-exports-are-not-allowed

@paoloricciuti paoloricciuti closed this as not planned Won't fix, can't repro, duplicate, stale Oct 23, 2024
@sockmaster27
Copy link
Contributor Author

This is not in runes mode though. I'm just trying to compile a Svelte 4 project using the new compiler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants