diff --git a/crates/js-component-bindgen/src/intrinsics/p3/async_task.rs b/crates/js-component-bindgen/src/intrinsics/p3/async_task.rs index 630742f0f..28ec82240 100644 --- a/crates/js-component-bindgen/src/intrinsics/p3/async_task.rs +++ b/crates/js-component-bindgen/src/intrinsics/p3/async_task.rs @@ -2208,7 +2208,7 @@ impl AsyncTaskIntrinsic { // TODO(breaking): remove checking for manual async specification here, once we can go p3-only // if (!isManualAsync && !isAsync && funcTypeIsAsync) {{ - const {{ promise, resolve }} = new Promise(); + const {{ promise, resolve }} = {promise_with_resolvers_fn}(); queueMicrotask(async () => {{ if (!subtask.isResolvedState()) {{ await task.suspendUntil({{ readyFn: () => task.isResolvedState() }}); @@ -2471,7 +2471,7 @@ impl AsyncTaskIntrinsic { // TODO(breaking): remove checking for manual async specification here, once we can go p3-only // if (!isManualAsync && !isAsync && funcTypeIsAsync) {{ - const {{ promise, resolve }} = new Promise(); + const {{ promise, resolve }} = {promise_with_resolvers_fn}(); queueMicrotask(async () => {{ if (!subtask.isResolvedState()) {{ await task.suspendUntil({{ readyFn: () => task.isResolvedState() }});