Failed
Open on GitHub

perf(router): fuse AST cloning and provenance construction

Self-Healing CI

Classification: Environment state

We traced all 9 failing tasks to three pre-existing, unrelated infrastructure issues: a Babel .inputSourceMap config validation error, RSC virtual:tanstack-rsc-runtime module resolution failures, and a parser error-message format drift in an error-overlay snapshot. None of these touch the two files this PR actually changes (router-utils/src/ast.ts and router-plugin/.../compilers.ts), which are scoped entirely to AST clone/provenance logic. The PR description itself confirms these exact errors reproduce identically on the unmodified #8504 baseline, so we're treating this as an inherited environment issue rather than something to fix here.

An empty commit was applied to the branch to trigger a new CI pipeline execution to resolve the environment issue.

None of the 9 failing tasks belong to a project in touched_projects (root, tanstack-solid-start-e2e-start-manifest, @tanstack/router-plugin, @tanstack/router-utils). The failing projects are e2e apps (tanstack-solid-start-e2e-basic, tanstack-vue-start-e2e-basic, tanstack-react-start-e2e-rsc, tanstack-react-start-e2e-rsc-rsbuild, tanstack-solid-start-e2e-deferred-hydration, tanstack-react-start-e2e-rsbuild, tanstack-react-start-e2e-rsc-deferred-hydration, tanstack-react-start-e2e-rsc-query), none of which were touched by this PR.

Inspecting the actual terminal output for each failing task showed the errors fall into exactly three unrelated buckets:

  1. Babel config validation: ".inputSourceMap must be a boolean, object, or undefined" thrown from @babel/core's loadPartialConfigAsync, surfaced through the Rsbuild babel-loader plugin during SSR builds (solid/vue/react-start-basic, rsc, rsc-rsbuild, deferred-hydration builds).
  2. RSC virtual-runtime resolution: "ENOENT ... virtual_tanstack-rsc-runtime.js" and "The argument 'path' must be a string, Uint8Array, or URL without null bytes. Received '\x00virtual:tanstack-rsc-runtime'" in the RSC build and RSC e2e/query/deferred-hydration test tasks — a virtual-module resolution failure inside the RSC rsbuild/vite plugin, not the code splitter.
  3. Parser diagnostic snapshot drift: the error-overlay e2e test expected "Unexpected token (16:22)" but received "<fixture-root>/src/routes/index.tsx: Unexpected token ';' (at 272)" — a difference in the underlying parser's error-message format, unrelated to AST cloning logic.

The PR's own diff is confined to packages/router-utils/src/ast.ts (rewriting cloneModuleAst/cloneGeneratedNode to fuse copying and provenance tracking into one traversal using a Map/WeakMap and manual object/array/RegExp copying) and packages/router-plugin/src/core/code-splitter/compilers.ts (consuming the new copiedNodes lookup instead of re-walking). Neither file touches Babel config options, Rsbuild/RSC virtual module resolution, or parser invocation/version. No package.json, lockfile, or bundler config changes are present in the PR diff either, ruling out a dependency-version explanation tied to this change.

The PR body independently corroborates this: the author states the initial CI run reproduced the same nine failing tasks with the same three error categories (Rsbuild/Babel input source-map validation, RSC virtual-runtime module resolution, Rsbuild parser diagnostic snapshot) on the exact unmodified #8504 baseline run, and that "those inherited failures remain unresolved by this cloning optimization." Flakiness rates for the sampled failing tasks were at or near 0%, ruling out flaky_task. Given the failing projects are untouched by the diff, the errors are semantically unrelated to AST cloning/provenance construction, and the author's own baseline comparison shows identical failures pre-existing the change, the failures are classified as environment_state — a pre-existing condition that should be fixed independently rather than folded into this optimization PR.