Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

fix flaky wasm test (#5810)

Shahmir Varqha66e9f7d1941d
diff --git a/frontend/src/core/wasm/utils.ts b/frontend/src/core/wasm/utils.ts
index 5cb8bebf95..d6d4718318 100644
--- a/frontend/src/core/wasm/utils.ts
+++ b/frontend/src/core/wasm/utils.ts
@@ -3,6 +3,7 @@
/**
* Whether the current environment is Pyodide/WASM
*/
-export function isWasm() {
- return document.querySelector("marimo-wasm") !== null;
+export function isWasm(): boolean {
+ // Document is sometimes undefined in CI so we check to reduce flakiness
+ return document && document.querySelector("marimo-wasm") !== null;
}