Skip to content

Commit

Permalink
fix: module
Browse files Browse the repository at this point in the history
  • Loading branch information
zlataovce committed Sep 7, 2024
1 parent 6a31904 commit 7e194e8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ const loadWorker = async (url) => {
throw new Error(`Failed to fetch worker`);
}
const script = await response.text();
return new Worker(URL.createObjectURL(new Blob([script], { type: "application/javascript" })));
return new Worker(URL.createObjectURL(new Blob([script], { type: "application/javascript" })), { type: "module" });
};
const worker = wrap(await loadWorker(new URL("./worker.js", import.meta.url)));
const krak = {
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const loadWorker = async (url: URL): Promise<Worker> => {

const script = await response.text();

return new Worker(URL.createObjectURL(new Blob([script], { type: "application/javascript" })));
return new Worker(URL.createObjectURL(new Blob([script], { type: "application/javascript" })), { type: "module" });
};

const worker = wrap<KrakWorker>(await loadWorker(new URL("./worker.js", import.meta.url)));
Expand Down

0 comments on commit 7e194e8

Please sign in to comment.