Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in Service Worker TypeError: Error URL.createObjectURL() not a function #65

Open
lucafaggianelli opened this issue Nov 2, 2023 · 3 comments

Comments

@lucafaggianelli
Copy link

Hi,

I'm trying to use the library in a service worker, but there the URL.createObjectURL() function is not available, do you have any workaround / idea?

@tsibg
Copy link

tsibg commented Nov 4, 2023

Hi,

I'm trying to use the library in a service worker, but there the URL.createObjectURL() function is not available, do you have any workaround / idea?

https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL_static

createObjectURL is not available in Service workers, only in Web workers. Quick search shows that the lib itsleft uses it to load the wasm files. So maybe use web worker if applicable?

Btw, the library itself seems to have an option to use web worker. It looks like it passes it down to the onnx wasm runtime configuration.

@lucafaggianelli
Copy link
Author

so the problem is that I'm using the lib in a browser extension and there I'm limited to running into a service worker or into the webpage context, but in both cases I have problems. If I run in the page context there are content security policy issues which I'm trying to root out as well.

@DanielHauschildt
Copy link
Contributor

Is there an alternative to createObjectURL?. Unfortunately, it is needed to properly convince the onnx-runtime to load the right stuff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants