Closed tamo closed 11 months ago
You are passing a URL to Worker constructor https://github.com/ffmpegwasm/ffmpeg.wasm/blob/afd04d914e144712491ab73eda509844d62b6a91/packages/ffmpeg/src/classes.ts#L166
but Worker's first argument is string:
https://html.spec.whatwg.org/multipage/workers.html#dedicated-workers-and-the-worker-interface
interface Worker : EventTarget { constructor(USVString scriptURL, optional WorkerOptions options = {});
Though TypeScript allows URL https://github.com/microsoft/TypeScript/blob/cac899d44d19a2753e6cae9ebc8bd291fa571c76/src/lib/webworker.generated.d.ts#L8409
declare var Worker: { prototype: Worker; new(scriptURL: string | URL, options?: WorkerOptions): Worker; };
I have a problem with https://github.com/jespertheend/Subworkers because it assumes the first argument is a string. https://github.com/jespertheend/Subworkers/blob/f28dd231641adf7f6b2d1c5dc0d4d43ecab42127/subworkers.js#L119 (a URL object doesn't have indexOf)
Please pass it with toString().
It is a common practice to use URL, so won't fix.
https://webpack.js.org/guides/web-workers/
Fair enough. URL is easier to use in TypeScript. Thanks for your comment.
You are passing a URL to Worker constructor https://github.com/ffmpegwasm/ffmpeg.wasm/blob/afd04d914e144712491ab73eda509844d62b6a91/packages/ffmpeg/src/classes.ts#L166
but Worker's first argument is string:
https://html.spec.whatwg.org/multipage/workers.html#dedicated-workers-and-the-worker-interface
Though TypeScript allows URL https://github.com/microsoft/TypeScript/blob/cac899d44d19a2753e6cae9ebc8bd291fa571c76/src/lib/webworker.generated.d.ts#L8409
I have a problem with https://github.com/jespertheend/Subworkers because it assumes the first argument is a string. https://github.com/jespertheend/Subworkers/blob/f28dd231641adf7f6b2d1c5dc0d4d43ecab42127/subworkers.js#L119 (a URL object doesn't have indexOf)
Please pass it with toString().