$effects created after the first top-level await never execute

#16691

Development PRs

Issue

Solved
O
Ocean-OS
Aug 30, 2025, 8:07 PM

Describe the bug

See The issue here is that regular user effects (ones made specifically with $effect, not $effect.pre or render effects) are deferred until the component is mounted. However, since the code that indicates the component as being mounted, $.pop, runs synchronously (even in async components), the effects are never added to the array of deferred effects for their component (and might(?) be added to the parent component if it exists) if they're created after the first top-level await.

Reproduction

Logs

System Info

N/A

Severity

annoyance

👍 2

Info

Closed at Sep 11, 2025, 2:58 PM
Assignees None
Labels None
Milestone None