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: various wasm fixes for those who self-host (#3160)

Myles Scolnick8e92b507c232
diff --git a/frontend/src/components/editor/file-tree/file-explorer.tsx b/frontend/src/components/editor/file-tree/file-explorer.tsx
index 9590b2b12d..d59ace6f00 100644
--- a/frontend/src/components/editor/file-tree/file-explorer.tsx
+++ b/frontend/src/components/editor/file-tree/file-explorer.tsx
@@ -544,7 +544,7 @@ const Node = ({ node, style, dragHandle }: NodeRendererProps<FileInfo>) => {
>
{node.data.isMarimoFile ? (
<img
- src="/favicon.ico"
+ src="./favicon.ico"
className="w-5 h-5 flex-shrink-0 mr-2 filter grayscale"
alt="Marimo"
/>
diff --git a/frontend/src/core/wasm/bridge.ts b/frontend/src/core/wasm/bridge.ts
index f5e8ce1ebd..806b58ddb7 100644
--- a/frontend/src/core/wasm/bridge.ts
+++ b/frontend/src/core/wasm/bridge.ts
@@ -295,7 +295,12 @@ export class PyodideBridge implements RunRequests, EditRequests {
"/kernel/save_user_config",
request,
{ baseUrl: "/" },
- );
+ ).catch((error) => {
+ // Just log to the console. It is likely a user who hosts their own web-assembly
+ // won't use this.
+ Logger.error(error);
+ return null;
+ });
};
saveAppConfig: EditRequests["saveAppConfig"] = async (request) => {
diff --git a/marimo/_server/templates/templates.py b/marimo/_server/templates/templates.py
index 3f9ed627d2..6e2689c168 100644
--- a/marimo/_server/templates/templates.py
+++ b/marimo/_server/templates/templates.py
@@ -256,7 +256,8 @@ def wasm_notebook_template(
body = body.replace("{{ config_overrides }}", json.dumps(config_overrides))
body = body.replace("{{ server_token }}", "123")
body = body.replace("{{ version }}", version)
- body = body.replace("{{ filename }}", filename)
+ # WASM runtime currently expect this to be notebook.py instead of the actual filename
+ body = body.replace("{{ filename }}", "notebook.py")
body = body.replace("{{ mode }}", "edit" if mode == "edit" else "read")
body = body.replace(
"</head>", '<marimo-wasm hidden=""></marimo-wasm></head>'