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 5ae248730..ec428db52 100644 --- a/crates/js-component-bindgen/src/intrinsics/p3/async_task.rs +++ b/crates/js-component-bindgen/src/intrinsics/p3/async_task.rs @@ -336,7 +336,7 @@ impl AsyncTaskIntrinsic { uwriteln!( output, r#" - const {var_name} = new WebAssembly.Global({{ value: 'i32', mutable: true }}, 0); + const {var_name} = globalThis.WebAssembly ? new globalThis.WebAssembly.Global({{ value: 'i32', mutable: true }}, 0) : false; "# ); }