diff --git a/src/tasks/worker.js b/src/tasks/worker.js index 18c5b979..e3596d72 100644 --- a/src/tasks/worker.js +++ b/src/tasks/worker.js @@ -15,9 +15,7 @@ let handleMessage = async data => { globalThis.onmessage = async ev => { if (ev.data.type == "init") { const { memory, module, id, import_url } = ev.data; - const imported = await import( - new URL(import_url, self.location.origin) - ); + const imported = await import(new URL(import_url)); // HACK: How we load our imports will change depending on how the code // is deployed. If we are being used in "wasm-pack test" then we can diff --git a/src/tasks/worker_handle.rs b/src/tasks/worker_handle.rs index 1091c77c..46af8c62 100644 --- a/src/tasks/worker_handle.rs +++ b/src/tasks/worker_handle.rs @@ -167,5 +167,5 @@ fn import_meta_url() -> String { static WORKER_URL: Lazy = Lazy::new(|| { let script = include_str!("worker.js"); let encoded = STANDARD.encode(script); - format!("data:application/javascript;base64,{encoded}") + format!("data:text/javascript;base64,{encoded}") });