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

When using transitions e.g out/in and dynamically showing an element, svelte leaks infinite style tags #7173

Closed
dtzxporter opened this issue Jan 21, 2022 · 4 comments

Comments

@dtzxporter
Copy link

dtzxporter commented Jan 21, 2022

Describe the bug

Using an element that renders based on a variable:

{#if showDiv}
<div out:fly={{x: 7, y: 7, duration: 150}} in:fly={{x: 7, y: 7, duration: 150}}>hi</div>
{/if}

Every time you toggle showDiv, a style tag is created and then emptied but remains in the DOM indefinitely:
Screen Shot 2022-01-21 at 4 01 59 PM

Removing the transitions solves the issue.

Reproduction

EDIT:

Reproduced (keep right clicking and see style tags get created and fail to clean up:
https://svelte.dev/repl/c89a3e9fb2ab4932bc0624e338ee147e?version=3.46.2

Too lazy to go and figure out which version broke, but 3.25.x doesn't leak, latest version(s) leak.

Logs

No error logs.

System Info

System:
    OS: macOS 12.0.1
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 957.99 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 14.18.2 - ~/.nvm/versions/node/v14.18.2/bin/node
    npm: 8.2.0 - ~/.nvm/versions/node/v14.18.2/bin/npm
  Browsers:
    Chrome: 97.0.4692.71
    Firefox: 96.0.2
    Safari: 15.1
  npmPackages:
    svelte: ^3.0.0 => 3.46.2 
    webpack: ^5.35.0 => 5.66.0

Severity

annoyance

@dtzxporter
Copy link
Author

Seems related to #7119 as that transition issue also doesn't happen on 3.25.0.

Looks like a race condition...

@MacFJA
Copy link

MacFJA commented Feb 5, 2022

Duplicate of #7164 ?

@martenfrisk
Copy link

martenfrisk commented Feb 9, 2022

I'm also having this problem. Based on your Repl, it looks like it occurs on 3.46.0 but not 3.45.0.

3.46.0 added the style: directive so that's probably the cause of the issue.

@bluwy
Copy link
Member

bluwy commented Feb 9, 2022

Yeah looks like a duplicate of #7164. Let's move the discussion there.

@bluwy bluwy closed this as completed Feb 9, 2022
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

4 participants