Backport #2925: Fix duplicate transforms of Nitro build artifacts#2928
Conversation
Signed-off-by: Nathan Colosimo <110621881+NathanColosimo@users.noreply.github.com>
🦋 Changeset detectedLatest commit: 759ef8b The changes in this PR will be included in the next version bump. This PR includes changesets to release 16 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
🧪 E2E Test Results❌ Some tests failed Summary
❌ Failed Tests🌍 Community Worlds (102 failed)redis (19 failed):
turso (83 failed):
Details by Category✅ ▲ Vercel Production
✅ 💻 Local Development
✅ 📦 Local Production
✅ 🐘 Local Postgres
✅ 🪟 Windows
❌ 🌍 Community Worlds
✅ 📋 Other
|
TooTallNate
left a comment
There was a problem hiding this comment.
Verified this backport against the original #2925 (which I reviewed on main earlier today) hunk by hunk, with attention on the AI-resolved conflicts. Approving.
Fidelity: vite.ts and the changeset are byte-identical to the original. The two files that differ are both correct context adaptations, not semantic drift:
index.ts: the sameworkflowBuildDir→ whole-buildDirexclusion swap (identical construction, including the trailing-slash discipline), applied against stable's surrounding context, which lacks main's world-target-injection code. I also checked the lint hazard this kind of resolution can create:joinfrom pathe remains used elsewhere in stable's file (manifest handler paths, steps bundle), so no unused import was left behind.index.test.ts: the resolution correctly added theviteWorkflowimport that main's test file already had from neighboring tests — stable's smaller test file needed it introduced.
Applicability confirmed: stable does ship the Nitro-in-Vite pipeline (vite.ts exists with the same exclusion logic, and the tanstack-start e2e lanes run on stable), so this fixes a real 4.x exposure rather than backporting dead code.
Verified locally on the branch: @workflow/nitro builds; the regression test passes (does not re-transform generated Nitro build artifacts, exercising both transform hooks with the serde-class crash vector and the sibling-directory negative case); the single biome warning is pre-existing on the stable baseline (identical before/after).
CI: every lane that exercises this change is green — nitro/nuxt/vite/tanstack-start across dev, prod, postgres, and Vercel-prod, plus all four workbench deployments. The 4 failures are the known stable-branch baseline set: Community World Turso (same lane failed on the #2818/#2926 backports), its required-check aggregator, and the chronically flaky hono/sveltekit Vercel-prod lanes — none of which touch the Nitro transform path.
Automated backport of #2925 to
stable(backport job run).AI recommendation: This is a self-contained bug fix that broadens the Nitro transform exclusion from only the pre-built
workflowbundle directory to all generated Nitro build artifacts, preventing duplicate class registration. The affected files (packages/nitro/src/index.tsandvite.ts) and the exactworkflowBuildDirexclusion logic being fixed exist unchanged onstable, and the change comes with a regression test, so it applies cleanly to the stable branch.Merge conflicts were resolved by AI (opencode with
anthropic/claude-opus-4.8). Please review the conflict resolution carefully before merging.