transformers.js icon indicating copy to clipboard operation
transformers.js copied to clipboard

v3 fails on Cloudflare Workers due to Webpack publicPath missing

Open vtempest opened this issue 1 year ago • 4 comments

System Info

Automatic publicPath is not supported in this browser

https://stackoverflow.com/questions/68115467/error-automatic-publicpath-is-not-supported-in-this-browser-when-i-am-running-m Just add: output: { publicPath: '', ... },

"@huggingface/transformers": "^3.0.0-alpha.14",

Environment/Platform

  • [X] Website/web-app
  • [x] Browser extension
  • [ ] Server-side (e.g., Node.js, Deno, Bun)
  • [ ] Desktop app (e.g., Electron)
  • [ ] Other (e.g., VSCode extension)

Description

Automatic publicPath is not supported in this browser

Reproduction

import { pipeline } from "@huggingface/transformers/" in cfw

https://developers.cloudflare.com/workers/wrangler/migration/v1-to-v2/wrangler-legacy/webpack/#example-with-webpack-plugin

vtempest avatar Sep 10 '24 04:09 vtempest

Also encountering this error. Any status on this? Thank you.

nnennajohn avatar Sep 20 '24 16:09 nnennajohn

Automatic publicPath is not supported in this browser

Is there a solution to using error reporting in plug-ins?

buildnewapp avatar Nov 26 '24 14:11 buildnewapp

this bug makes it impossible to run transformers.js in v0, because we don't have access to the webpack-config, even when v0 itself thinks it can help.

do we even need to auto-detect the publicPath?

TimPietrusky avatar Feb 24 '25 10:02 TimPietrusky

Revisiting this - does the issue still occur for Transformers.js v3.3.3?

xenova avatar Mar 03 '25 15:03 xenova

I reproduced this with v3.3.2 in Firefox, and after updating to 3.3.3 it appears to be resolved.

jesseditson avatar Jun 02 '25 23:06 jesseditson

It seems as though cloudflare workers are unsuitable for running Transformers.js, because (1) wasm code generation is disabled and (2) node addons aren't supported. For this reason, we'll close this issue as not planned for now... but hopefully this will be possible in future!

If anyone knows more or has any ideas, please feel free to share!

See https://github.com/huggingface/transformers.js/pull/1333#issuecomment-2988694866 for more information on what I've tried.

xenova avatar Jun 19 '25 18:06 xenova