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

{#each} block does not work with Set() #3961

Closed
ahopkins opened this issue Nov 20, 2019 · 1 comment
Closed

{#each} block does not work with Set() #3961

ahopkins opened this issue Nov 20, 2019 · 1 comment

Comments

@ahopkins
Copy link

Describe the bug
The {#each}{/each} expression does not operate on a Set().

Logs

RangeError: invalid array length

To Reproduce

See example here

In the above link, it works as expected. At the very end there is an {#each}{/each} block that has been commented out. If you uncomment that block you will see the error in the console.

Expected behavior

To loop thru thru the set object (perhaps by calling forEach) the same way it would thru an array.

Information about your Svelte project:

Browser: Firefox Developer Edition 68.0b2 (64-bit)
OS:

Distributor ID:	Arch
Description:	Arch Linux
Release:	rolling
Codename:	n/a

Svelte: "svelte": "^3.0.0" with "rollup-plugin-svelte": "^5.0.3",

Severity

Annoying and slightly unexpected. Seems like a potential minor fix. But there is a workaround.

{#each [...$pageloader.active] as call}
    - {call}<br />
{/each}
@Conduitry
Copy link
Member

Duplicate of #3225 - this is intentionally not a feature.

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

No branches or pull requests

2 participants