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

Site REPL started "hanging" as I tried to produce an example for a different bug #4636

Closed
PixievoltNo1 opened this issue Apr 6, 2020 · 5 comments
Labels

Comments

@PixievoltNo1
Copy link

Describe the bug
As I was trying to put together a demonstration for a different bug, the REPL seems to have entered a state where not only can it not compile the demonstration, it also cannot react to any changes in the code, and cannot save any new versions (attempting to save gets a window.alert box saying "r is null"). I can load the version I somehow managed to save already, but this just puts the REPL back in the same state.

Logs
The "Result" pane has a message stuck on "bundling ./App.svelte".

The browser's console says:

Console was cleared.
running Svelte compiler version 3.20.1
Error: Identifier 'item' has already been declared (Note that you need plugins to import files that are not JavaScript)

To Reproduce
https://svelte.dev/repl/4e483e1700e04ea79dfd8cb4250d5bd0?version=3.20.1

Expected behavior
Even if there's a bug preventing the entered code from compiling correctly, I should always be able to rewrite the code and try to make the new code compile, and I should always be able to save new versions of the code to my GitHub account.

Information about your Svelte project:
This concerns the REPL live on svelte.dev.

Severity
I may or may not have other bugs to tell you about, but with the REPL in this state, I feel that trying to put together evidence of their existence is more trouble than it's worth.

Additional context
aaaaaaaaaaaaaaaaaaaaaaaaaaaargh

@pushkine
Copy link
Contributor

pushkine commented Apr 6, 2020

There is a clash between component name and each_value name in create_each_block

let item = /*item*/ ctx[6];
const item = new Item({ props: item_props, $$inline: true });

@Th0rN13
Copy link
Contributor

Th0rN13 commented May 2, 2020

This issue can be easily fixed with prefix for component name variable, but need approve prefix,
simple $ may cause a similar problem with stores, so i suggect $c_ (c for component)

@Conduitry
Copy link
Member

Here's a stripped down version of the repro

<script>
	const components = [];
</script>

<ul>
	{#each data as item}
		<Item bind:this={components[item]} />
	{/each}
</ul>

This wouldn't actually run anyway because of the missing data and Item, but it does demonstrate that the item that contains the loop variable that's used in the dynamic bind:this isn't getting properly deconflicted with the item that contains the component instance.

@Conduitry
Copy link
Member

The bind:this variable should no longer conflict with other variables as of 3.23.2 - https://svelte.dev/repl/4e483e1700e04ea79dfd8cb4250d5bd0?version=3.23.2

@PixievoltNo1
Copy link
Author

I'll call that "good enough for my purposes". I'm not sure how I feel about the REPL not being robust enough in the face of Svelte bugs like this one, but as long as there are no such (known) bugs, it doesn't matter.

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

Successfully merging a pull request may close this issue.

4 participants