Skip to content

fix(turbopack): handle undefined defaults in dynamic URLs - #192

Merged
fireairforce merged 2 commits into
utoofrom
zoomdong/fix-dynamic-url-alternatives
Sep 10, 2026
Merged

fireairforce merged 2 commits into
utoofrom
zoomdong/fix-dynamic-url-alternatives

Conversation

@fireairforce

@fireairforce fireairforce commented Sep 10, 2026 •

Copy link
Copy Markdown
Member

Summary

Fix the @ffmpeg/ffmpeg build error Can't resolve (<dynamic> | 'undefined'). Its defaulted options argument makes a runtime Worker URL appear as <dynamic> | undefined during analysis.

Exclude undefined when checking whether an otherwise dynamic URL has constant parts. Real static alternatives still go through existing resolution, so a URL such as new URL(override ?? './fallback.txt', import.meta.url) continues to emit its fallback asset.

The single regression fixture lives in utooland/utoo#3345 and covers both cases.

Verification

  • All 5 static-asset snapshot tests passed.
  • The original dumi 2.4.49 + @ffmpeg/ffmpeg 0.12.15 demo builds with the updated release-local native binding.
  • Workspace Clippy, the modified Turbopack library's Clippy, and formatting checks passed.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-10T07:16:13.399266Z e188401 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

if ignore_dynamic_requests {
return Ok(());

P1 Badge Preserve static assets when one URL alternative is dynamic

When ignore_dynamic_requests is enabled, a mixed expression such as new URL(override ?? './worker.js', import.meta.url) now returns here because the override alternative is unconstrained. That skips the entire UrlAssetReference, so ./worker.js is no longer added to the module graph or emitted; when override is absent and the static fallback is selected at runtime, the URL points relative to the generated bundle and typically 404s. Preserve the runtime alternative without dropping resolvable static alternatives.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@fireairforce fireairforce changed the title fix(turbopack): preserve dynamic URL alternatives fix(turbopack): handle undefined defaults in dynamic URLs Sep 10, 2026
@fireairforce
fireairforce merged commit 3cae2b0 into utoo Sep 10, 2026
15 of 28 checks passed
fireairforce added a commit that referenced this pull request Sep 14, 2026
Rebased onto vercel/next.js canary 3c9d1ca. Includes the previous
utoo follow-ups:

- feat(turbo-tasks): expose completed task count (#187)
- fix(turbopack): preserve CSS chunk order in identity (#188)
- feat(turbopack): support React 17 compiler target (#189)
- fix(turbopack): honor default chunk content hashing (#190)
- fix(turbopack): fall back after filtering declaration path aliases (#191)
- fix(turbopack): handle undefined defaults in dynamic URLs (#192)

Adaptations for this sync:

- swc v77: build Function.body as FunctionBody in async_module.rs
- turbo-tasks GC roots: extend the wasm in-memory backing storage stub
- lazy dynamic imports: port the follow-reexports evaluation/side-effect
  semantics into module_canonicalization.rs
- strict factory chunks: keep browser_global_ident and compress options
  in the rewritten chunk emitters

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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