Skip to content

@remotion/whisper-web: fix package not working in Vite and upgrade whisper.cpp to 1.7.5 #5302

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

Merged
merged 6 commits into from
May 25, 2025

Conversation

samohovets
Copy link
Member

@samohovets samohovets commented May 19, 2025

Copy link

vercel bot commented May 19, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
bugs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 21, 2025 10:54pm
remotion ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 21, 2025 10:54pm

@JonnyBurger JonnyBurger changed the title @remotion/whisper-web fixes and refines @remotion/whisper-web: fixes and refines May 21, 2025
@samohovets samohovets changed the title @remotion/whisper-web: fixes and refines @remotion/whisper-web: fix package not working in Vite, upgrade to whisper 1.7.5, refactor May 21, 2025
@samohovets
Copy link
Member Author

samohovets commented May 21, 2025

After a long investigation, I've decided to leave a note in the docs about Vite instead of patching the compiled main.js.

Simplified, the current problem looks like this:

  • Webpack doesn't work with new Worker(new URL(import.meta.url)) syntax. It was fixed recently; however, a lot of frameworks and setups are using the old webpack version, and we should not require everyone to upgrade to use the package.

  • Vite doesn't work correctly when spawning the worker like this: new Worker(new URL('./main.js', import.meta.url)) (default emscripten way). It's a known issue.

So, it's just that Vite dep optimizer doesn't support this.

For now, let's recommend using optimizeDeps.exclude.

Hopefully, this will be fixed on the Vite side in the future.

Leaving the list of issues here for reference:

@samohovets samohovets marked this pull request as ready for review May 21, 2025 22:34
@samohovets samohovets requested a review from JonnyBurger May 21, 2025 22:35
@samohovets samohovets changed the title @remotion/whisper-web: fix package not working in Vite, upgrade to whisper 1.7.5, refactor @remotion/whisper-web: fix package not working in Vite and upgrade whisper.cpp May 22, 2025
@samohovets samohovets changed the title @remotion/whisper-web: fix package not working in Vite and upgrade whisper.cpp @remotion/whisper-web: fix package not working in Vite and upgrade whisper.cpp to 1.7.5 May 22, 2025
@JonnyBurger JonnyBurger merged commit c5d4ea1 into main May 25, 2025
13 of 14 checks passed
@JonnyBurger JonnyBurger deleted the support/whisper-web-refine branch May 25, 2025 11:21
@JonnyBurger
Copy link
Member

JonnyBurger commented May 25, 2025

Thank you!

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

Successfully merging this pull request may close these issues.

Compiled code using pthreads breaks Vite bundler
2 participants