-
-
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
running {#await} inside an {#if} #1496
Comments
I think it makes sense to work on this right after or alongside #1514, because that's going to touch the await block code anyway. I just have yet to find a way of dealing with that issue that I'm happy with. |
Using svelte": "2.13.2" I'm facing same issue:
Initially, Any idea, how to resolve? I tried the same thing with following:
Same issue is there. It tries to remove the element twice. In the following code:
First time when it detaches Node, node is getting destroyed rightly but it automatically tries to detach second time as well. 2nd time when it does, it is Text Node: Issue also comes with await example in documentation. |
After few hours of trying, got a resolution.
Why?
Results were same, but it popped up different error this time, which was of |
How's the progress on this? I've just been avoiding |
You may be able to apply this quick hack to get the project running: #2086 (comment) |
The original gist is 404ing — does anyone know if it's still happening, and can repro? |
IIRC the original repro - converted into v3 - was something like this: <script>
let promise = new Promise(res => setTimeout(res, 2000));
let flag = true;
setTimeout(() => flag = false, 1000);
</script>
{#if flag}
{#await promise then _}DONE{/await}
{/if} which does seem to still be an issue. We're trying to do |
prevent await block mounting inside removed if block
Fixed at last in 3.6.3 |
REPL
If we have a
{#await}
block running inside a truthy{#if}
and, for some reason, the{#if}
evaluates to false while the promise is still running, we get an error:The text was updated successfully, but these errors were encountered: