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

Critical: keyed each block renders items in the wrong order starting in version 3.38.0 #6535

Closed
isaacHagoel opened this issue Jul 16, 2021 · 1 comment
Labels

Comments

@isaacHagoel
Copy link

Describe the bug

Starting in Svelte version 3.38.0, if you have a keyed each block (didn't test unkeyed), after (very) few updates, Svelte starts rendering the items in the wrong order (== the order on the screen does not match the order in the array).

I have provided a minimal yet detailed example (REPL) below.

If you change the Svelte version to 3.37.0 or anything prior (in the provided REPL's URL), you'll see that it starts working fine.

This also affects SvelteKit.

It reproduces in the REPL and locally.
It seems to be browser independent (tested on Chrome and FFX and Safari).

Reproduction

https://svelte.dev/repl/b255c81059ce4b81aab963d837d29aab?version=3.38.3

The instructions are in the REPL.
Basically click a button a few of times to re-shuffle an array that is rendered via a keyed each block.
When the order gets out of sync it will be indicated on screen (wait for the red colour).

Logs

No console output. It breaks silently.

System Info

System:
    OS: macOS 11.4
    CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
    Memory: 24.05 GB / 64.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 12.16.2 - ~/.nvm/versions/node/v12.16.2/bin/node
    Yarn: 1.22.10 - ~/.nvm/versions/node/v12.16.2/bin/yarn
    npm: 7.16.0 - ~/.nvm/versions/node/v12.16.2/bin/npm
  Browsers:
    Brave Browser: 86.1.15.76
    Chrome: 91.0.4472.114
    Firefox: 89.0.2
    Safari: 14.1.1
  npmPackages:
    rollup: ^1.20.0 => 1.32.1 
    svelte: ^3.38.3 => 3.38.3

Severity

blocking an upgrade

@dummdidumm
Copy link
Member

Duplicate of #6444 . This will be fixed with the next release.

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

No branches or pull requests

2 participants