-
Notifications
You must be signed in to change notification settings - Fork 974
Open
Labels
bugSomething isn't workingSomething isn't working
Description
System Info
transformers: 3.6.2
deno: 2.4.1
Environment/Platform
- Website/web-app
- Browser extension
- Server-side (e.g., Node.js, Deno, Bun)
- Desktop app (e.g., Electron)
- Other (e.g., VSCode extension)
Description
Using Deno and running transformers.js inside WebWorker tries to call OffscreenCanvas
:
if (IS_BROWSER_OR_WEBWORKER) {
// Running in browser or web-worker
createCanvasFunction = (/** @type {number} */ width, /** @type {number} */ height) => {
if (!self.OffscreenCanvas) {
throw new Error('OffscreenCanvas not supported by this browser.');
}
return new self.OffscreenCanvas(width, height)
};
loadImageFunction = self.createImageBitmap;
ImageDataClass = self.ImageData;
}
But Deno doesn't support OffscreenCanvas
. Can we skip this condition for Deno? This issue started after update of the package version. On old version of transformers.js it was running without any error for Deno. Thanks.
Reproduction
calling const image = await RawImage.fromURL(...);
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working