Skip to content

Commit

Permalink
Fixed the URL up so it works
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael-F-Bryan committed Jan 5, 2024
1 parent ad304b4 commit eac529c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions src/tasks/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/tasks/worker_handle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,5 +167,5 @@ fn import_meta_url() -> String {
static WORKER_URL: Lazy<String> = 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}")
});

0 comments on commit eac529c

Please sign in to comment.