threads.js
threads.js copied to clipboard
Unexpected Token
To avoid Unexpected Token Error, just use:
const worker = await spawn(new Worker(new URL("./worker.js", import.meta.url)));
instead of:
const worker = await spawn(new Worker("./worker.js"))
Thanks for sharing, @ttessarolo!
We should document that somewhere… Feel free to propose a PR.
@andywer remote: Permission to andywer/threads.js.git denied ;)
Fork on github, make changes on your fork, make pull request from your fork to here :)
Thanks for sharing, @ttessarolo!
We should document that somewhere… Feel free to propose a PR.
I'm using typescript and it says new Worker
only gets string
:
Argument of type 'URL' is not assignable to parameter of type 'string'