xenova / whisper-web

ML-powered speech recognition directly in your browser
https://hf.co/spaces/Xenova/whisper-web
MIT License
1.29k stars 152 forks source link

Development in firefox instruction #8

Closed PushpenderSaini0 closed 1 year ago

PushpenderSaini0 commented 1 year ago

I was having trouble running this in dev mode in firefox. Loading worker.js will fail with SyntaxError: import declarations may only appear at top level of a module

This is because firefox does not support worker modules by default

Fix / Workaround

If you wish to run this in dev mode in firefox you will have to enable it manually via about:config and set dom.workers.modules.enabled to true

This was added in firefox111 if you have older version this may not work

PushpenderSaini0 commented 1 year ago

Add this in README.md for people using firefox. You can assign it to me, and I can raise a PR.

xenova commented 1 year ago

Just to clarify, you mean you are unable to run the dev server (using npm run dev)? I have tested the demo app in Firefox and it does seem to work.

Is this perhaps a known issue with vite's development mode?

Edit: Re-reading your issue, are you referring to "Firefox Developer Edition"?

PushpenderSaini0 commented 1 year ago

Yes , you won't be able to run the app in firefox when using the command npm run dev but it will run fine once it's build.

No i am not referring to "Firefox Developer Edition"

xenova commented 1 year ago

Okay I see, thanks for pointing that out! I just tested and you're right. 👍 Please feel free to make a PR with the note under step 2.