fix: disallow effect creation after `await` (#18299)
We incorrectly restore effect context after an`$derived(await ...)` if it occurs inside an async function, but only for those, no other `await` expressions. This is buggy and wrong. We only want to restore context _inside_ an async derived expression (including template expressions)` so that `await a + b` works correctly. It's possible that this will be a breaking change (albeit not semver-violating, because `experimental`) for some people if they are creating effects after an `await` (other than at the top level of a component). This is regrettable, but it should never have worked in the first place.
R
Rich Harris committed
0da9f9e2ab515da16d624c5bc48b554beb179f92
Parent: d4be4e2
Committed by GitHub <noreply@github.com>
on 5/27/2026, 7:58:57 PM