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.
Python artificial-intelligencedagdata-sciencedata-visualizationdataflowdeveloper-toolsmachine-learningnotebookspipelinepythonreactivesqlweb-app
fix: try to load worker from file, and fallback to inline (#959)
Myles Scolnick2cd3ea3e8783
diff --git a/frontend/src/core/pyodide/bridge.ts b/frontend/src/core/pyodide/bridge.tsindex 3ae40e64b6..f067450e56 100644--- a/frontend/src/core/pyodide/bridge.ts+++ b/frontend/src/core/pyodide/bridge.ts@@ -55,10 +55,24 @@ export class PyodideBridge implements RunRequests, EditRequests {constructor() {if (isPyodide()) {- // Create a worker- const worker = new InlineWorker({- name: getMarimoVersion(),- });+ // Create a worker, try by URL then inline+ let worker: Worker;+ const version = getMarimoVersion();+ if (window.Worker) {+ try {+ worker = new Worker(new URL("worker/worker", import.meta.url), {+ type: "module",+ /* @vite-ignore */+ name: version,+ });+ } catch {+ Logger.debug("Failed to create worker by URL, trying inline.");+ worker = new InlineWorker({ name: version });+ }+ } else {+ Logger.debug("Worker not available, using inline worker.");+ worker = new InlineWorker({ name: version });+ }// Create the RPCthis.rpc = getWorkerRPC(worker);