Repository navigation
Conversation
This reverts commit 812c88f.
52b3692 to
4e48039
Compare
Failing test suitesCommit: 4e48039 | About building and testing Next.js
Expand output● syntax-highlighter-crash › should render the page
Expand output● API routes › should return data when catch-all ● API routes › should return redirect when catch-all with index and trailing slash ● API routes › should return data when catch-all with index and trailing slash ● API routes › should return data when catch-all with index and no trailing slash
Expand output● _allow-underscored-root-directory › should not serve app path with underscore ● _allow-underscored-root-directory › should pages path with a underscore at the root ● _allow-underscored-root-directory › should serve app path with %5F
Expand output● app-dir Image Component from node_modules › should apply image config for node_modules
Expand output● Skipped in Turbopack › app-dir - optimizePackageImports - mui › should build successfully
Expand output● Image Component from node_modules › should apply image config for node_modules ● Image Component from node_modules › should warn when using images.domains config
Expand output● app dir - external dependency › should be able to opt-out 3rd party packages being bundled in server components ● app dir - external dependency › should handle external async module libraries correctly ● app dir - external dependency › should transpile specific external packages with the ● app dir - external dependency › should resolve the subset react in server components based on the react-server condition ● app dir - external dependency › should resolve 3rd party package exports based on the react-server condition ● app dir - external dependency › should correctly collect global css imports and mark them as side effects ● app dir - external dependency › should handle external css modules ● app dir - external dependency › should use the same export type for packages in both ssr and client ● app dir - external dependency › should handle external css modules in pages ● app dir - external dependency › should handle external next/font ● app dir - external dependency › should not apply swc optimizer transform for external packages in browser layer in web worker ● app dir - external dependency › react in external esm packages › should use the same react in client app ● app dir - external dependency › react in external esm packages › should use the same react in server app ● app dir - external dependency › react in external esm packages › should use the same react in edge server app ● app dir - external dependency › react in external esm packages › should use the same react in pages ● app dir - external dependency › react in external esm packages › should support namespace import with ESM packages ● app dir - external dependency › react in external esm packages › should apply serverExternalPackages inside of node_modules ● app dir - external dependency › mixed syntax external modules › should handle mixed module with next/dynamic ● app dir - external dependency › mixed syntax external modules › should handle mixed module in server and client components ● app dir - external dependency › should emit cjs helpers for external cjs modules when compiled ● app dir - external dependency › should export client module references in esm ● app dir - external dependency › should support client module references with SSR-only ESM externals ● app dir - external dependency › should support exporting multiple star re-exports ● app dir - external dependency › should have proper tree-shaking for known modules in CJS ... truncated ...
Expand output● API routes › should return data when catch-all ● API routes › should return redirect when catch-all with index and trailing slash ● API routes › should return data when catch-all with index and trailing slash ● API routes › should return data when catch-all with index and no trailing slash
Expand output● _allow-underscored-root-directory › should not serve app path with underscore ● _allow-underscored-root-directory › should pages path with a underscore at the root ● _allow-underscored-root-directory › should serve app path with %5F
Expand output● output: standalone with ESM app dir › should work correctly with output standalone
Expand output● app-dir client-components-tree-shaking › should only include imported components 3rd party package in browser bundle with direct imports ● app-dir client-components-tree-shaking › should only include the imported identifier of CJS module in browser bundle ● app-dir client-components-tree-shaking › should able to resolve the client module entry with mixing rexports ● app-dir client-components-tree-shaking › should handle mixing namespace imports and named imports from client components ● app-dir client-components-tree-shaking › should only include imported relative components in browser bundle with direct imports
Expand output● react@experimental - blockingSSR › should opt into the react@experimental channel when blockingSSR is enabled
... truncated to fit in one GitHub comment ... |
### What? Generate **both RSC client-reference proxies and WebAssembly loaders** under their graph-backed wrapper module identities, using one shared, higher-level content helper. Remove both generated-path exceptions from `BindingUsageInfo::used_exports` and the earlier proxy-specific export filter. ### Why? The wrapper is the module in Turbopack's graph, but its chunk item previously delegated code generation to a separately processed virtual JS module. Export-usage lookup for that proxy/loader missed the graph and fell back to “all exports used.” In a `sideEffects: false` barrel this could register a pruned client export and request a missing `<locals>` module ID. The WebAssembly loader had the same graph-identity mismatch, hidden by a separate filename-based fallback. Canary's #99102 now guards against the client-reference missing-ID symptom by checking pruned references. This PR fixes the upstream identity mismatch instead so `expand_exports()` sees real usage; #99102's independent safety checks remain in place. ### How? `chunk_item_content_with_code_from(graph_module, code_source, ...)` takes the generated source's analyzed program, references, exports, source map and async behavior while using the wrapper for the *whole code-generation module context*. Both client-reference and WASM wrappers call it. This replaces the public low-level `with_module_context` setter; it does not change module IDs, WASM output assets, React Flight registration, or the existing single-chunk WASM rejection. sokra's `ResolvedVc` suggestions are also applied. #99090's pruned-reexport-source guard remains necessary: removing it independently still fails its execution fixture. #99082 proposed reverting all of #98617 and closed unmerged; it was not a separate fix to delete. The neutral production proxy regression and two supplemental pruned-source execution fixtures remain in the PR. ### Verification - **WASM can-fail/can-pass:** all 3 existing WASM execution fixtures pass before removing the fallback; with the fallback removed but old loader delegation retained, all 3 fail `export usage not found ...wasm_.loader.mjs`; with the shared helper, all 3 pass (instantiation, imported functions/memory, and `?module` compilation). - **Proxy can-fail/can-pass:** without the wrapper-context path and proxy fallback, the production fixture fails `export usage not found .../__nextjs-internal-proxy.mjs`; with the fix it passes. - **Rust/build:** 1,282 tests pass across affected crates; clippy (`-D warnings`), rustfmt and `pnpm build-all` (18/18 tasks) pass. - **Next.js integration:** Turbopack production 6 suites/12 tests (proxy, used client references, #99102 regression, edge WASM and WASM output tracing); development 3 suites/8 tests (proxy, used client references and edge WASM). Client-reference chunking 1/1. After rebasing onto current canary, `pnpm build-all` and focused proxy/edge WASM production tests (3 suites/7 tests) pass again. <!-- NEXT_JS_LLM --> <!-- fleet ecdfa248-cd54-41ac-b4a2-c9d49e2a67ee --> --------- Co-authored-by: vercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com> Co-authored-by: Tobias Koppers <1365881+sokra@users.noreply.github.com> Co-authored-by: Luke Sandberg <210140+lukesandberg@users.noreply.github.com>
Reverts #98617