[pull] canary from vercel:canary - #1304
Merged
Merged
Conversation
### What?
Turbopack's output-file tracer no longer fails the build when a Node.js
App Route's server-external package graph reaches a `.wasm` file.
### Why?
Since Turbopack still mapped `.wasm` / `.wat` to
`ModuleType::WebAssembly`
while tracing, the generated loader's embedded runtime helper
(`[turbopack-wasm]/node/loadWasm.ts`) got pulled into the traced file
list. `NftJsonAsset` only accepts paths under `[project]` or `[output]`,
so it raised a fatal error and `next build` never finished.
### How?
`turbopack/crates/turbopack/src/module_options/mod.rs`: map WASM sources
to `ModuleType::Raw` when `analyze_mode == AnalyzeMode::Tracing`, the
same
way `.json` and `import … with { type: "text" | "bytes" }` are already
handled for tracing. The real `.wasm` file keeps its filesystem path in
the trace; no loader or embedded helper is created. Non-tracing bundling
behavior is unchanged.
Adds `test/production/turbopack-wasm-output-tracing/`, a production
regression test that fails on the recorded baseline with
NftJsonAsset: cannot handle filepath '[turbopack-wasm]/node/loadWasm.ts'
and passes with the fix, asserting the embedded helper is absent from
the
route's `.nft.json` while the real `.wasm` file is still traced.
Closes #97338
Closes #96897
Co-authored-by: vercel-fleet[bot] <308483924+vercel-fleet[bot]@users.noreply.github.com>
> for cache invalidation That was inaccurate.
Pull in test from vercel/nft#604 It was already passing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )