diff --git a/pkg/dart2wasm/bin/run_wasm.js b/pkg/dart2wasm/bin/run_wasm.js index ef44cc503db..f15ab2dd9ad 100644 --- a/pkg/dart2wasm/bin/run_wasm.js +++ b/pkg/dart2wasm/bin/run_wasm.js @@ -42,6 +42,8 @@ const main = async () => { return new WebAssembly.Instance(compile(filename), imports); } + globalThis.window ??= globalThis; + let importObject = {}; // Is an FFI module specified? diff --git a/pkg/dart2wasm/lib/target.dart b/pkg/dart2wasm/lib/target.dart index 429be517168..f65addbad36 100644 --- a/pkg/dart2wasm/lib/target.dart +++ b/pkg/dart2wasm/lib/target.dart @@ -69,6 +69,7 @@ class WasmTarget extends Target { 'dart:nativewrappers', 'dart:io', 'dart:js_interop', + 'dart:js', 'dart:js_util', 'dart:wasm', 'dart:developer',