Repository navigation
fix(turbopack): handle undefined defaults in dynamic URLs - #192
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
next.js/turbopack/crates/turbopack-ecmascript/src/references/mod.rs
Lines 2003 to 2004 in e188401
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".
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>
Summary
Fix the
@ffmpeg/ffmpegbuild errorCan't resolve (<dynamic> | 'undefined'). Its defaulted options argument makes a runtime Worker URL appear as<dynamic> | undefinedduring analysis.Exclude
undefinedwhen checking whether an otherwise dynamic URL has constant parts. Real static alternatives still go through existing resolution, so a URL such asnew 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
@ffmpeg/ffmpeg0.12.15 demo builds with the updatedrelease-localnative binding.