Skip to content

fix(ffmpeg): resolve classWorkerURL in the UMD build - #93

Merged
Project516 merged 1 commit into
masterfrom
fix/umd-class-worker-url
Oct 6, 2026
Merged

Project516 merged 1 commit into
masterfrom
fix/umd-class-worker-url

Conversation

@Project516

Copy link
Copy Markdown
Owner

load({ classWorkerURL }) fails in the UMD build with Cannot find module 'blob:...'. Webpack compiles new URL(classWorkerURL, import.meta.url) with a non-literal first argument into a module context lookup, so any URL passed at runtime misses.

The URL is now built through a helper. The ESM build still resolves it against import.meta.url. The UMD build has no module URL, so it resolves against self.location.href, which is what new Worker() does with a relative URL anyway.

Checked by building dist/umd/ffmpeg.js before and after: the old bundle contains the Cannot find module stub, and the new one calls new Worker(new URL(url, self.location.href)). #88's browser test passes a blob: classWorkerURL through the UMD build and will exercise this once rebased.

@coderabbitai

coderabbitai Bot commented Oct 6, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 57 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 29cb7679-8a8b-4a03-8fb0-3138297e6a4c
📥 Commits

Reviewing files that changed from the base of the PR and between 99a5cc5 and c0afb41.

📒 Files selected for processing (2)
  • CHANGELOG.md
  • packages/ffmpeg/src/classes.ts
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@project516-review-bot project516-review-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change fixes the UMD build's handling of classWorkerURL by introducing a helper function resolveWorkerURL that uses self.location.href as the base for UMD builds and import.meta.url for ESM builds. This prevents Webpack from misinterpreting non-literal URLs as module lookups. The CHANGELOG is updated to reflect the fix.


review-bot, model nvidia/nemotron-3-super-120b-a12b:free, verdict approve

@Project516
Project516 merged commit 73567d3 into master Oct 6, 2026
21 checks passed
@Project516
Project516 deleted the fix/umd-class-worker-url branch October 6, 2026 16:12
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.

1 participant