-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
import variables conflicting with #each block variable #5834
Comments
In a working case, the compiled JS just references the imported action variable directly. (e.g. In the broken case, it tries to use Notably, this appears to be limited to I'm not really familiar with this part of the compiler, but happy to take a look when I have time (probably next week) if nobody else can get to it first. |
This is fixed in 3.31.2 - https://svelte.dev/repl/40e6e91f00bb43788baba1f34ee7f95c?version=3.31.2 |
Is this about svelte@next? This project is currently in a pre-release stage and breaking changes may occur at any time. Please do not post any kind of bug reports or questions on GitHub about it.
No.
Describe the bug
When importing an action that has the same name of the
as
in an each block, it breaks the import variable, replaces it, somehow bleeds out or isn't getting scoped properly.Logs
Error message:
Cannot read property 'call' of undefined
To Reproduce
https://svelte.dev/repl/40e6e91f00bb43788baba1f34ee7f95c?version=3.31.0
Expected behavior
Each blocks should be scoped and not interfere with imported variables.
Information about your Svelte project:
Repl from svelte.dev
Severity
Now that I'm aware there is no problem working around it, solutions and workarounds are in the repl comments and easy to fix by simply using non conflicting names. Tho for newer developers this might be one annoying unexpected interaction to track down.
Additional context
I'm not sure where else this might apply other than on actions and each loops or if this is a bug isolated to those interactions.
The text was updated successfully, but these errors were encountered: