Skip to content

Backport #2925: Fix duplicate transforms of Nitro build artifacts#2928

Merged
NathanColosimo merged 2 commits into
stablefrom
backport/pr-2925-to-stable
Jul 14, 2026
Merged

Backport #2925: Fix duplicate transforms of Nitro build artifacts#2928
NathanColosimo merged 2 commits into
stablefrom
backport/pr-2925-to-stable

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

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 workflow bundle directory to all generated Nitro build artifacts, preventing duplicate class registration. The affected files (packages/nitro/src/index.ts and vite.ts) and the exact workflowBuildDir exclusion logic being fixed exist unchanged on stable, 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.

Signed-off-by: Nathan Colosimo <110621881+NathanColosimo@users.noreply.github.com>
@changeset-bot

changeset-bot Bot commented Jul 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 759ef8b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 16 packages
Name Type
@workflow/nitro Patch
@workflow/nuxt Patch
workflow Patch
@workflow/world-testing Patch
@workflow/core Patch
@workflow/builders Patch
@workflow/cli Patch
@workflow/next Patch
@workflow/vitest Patch
@workflow/web-shared Patch
@workflow/web Patch
@workflow/astro Patch
@workflow/nest Patch
@workflow/rollup Patch
@workflow/sveltekit Patch
@workflow/vite Patch

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

@vercel

vercel Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
example-nextjs-workflow-turbopack Ready Ready Preview, Comment Jul 14, 2026 11:16pm
example-nextjs-workflow-webpack Ready Ready Preview, Comment Jul 14, 2026 11:16pm
example-workflow Ready Ready Preview, Comment Jul 14, 2026 11:16pm
workbench-astro-workflow Ready Ready Preview, Comment Jul 14, 2026 11:16pm
workbench-express-workflow Ready Ready Preview, Comment Jul 14, 2026 11:16pm
workbench-fastify-workflow Ready Ready Preview, Comment Jul 14, 2026 11:16pm
workbench-hono-workflow Ready Ready Preview, Comment Jul 14, 2026 11:16pm
workbench-nitro-workflow Ready Ready Preview, Comment Jul 14, 2026 11:16pm
workbench-nuxt-workflow Ready Ready Preview, Comment Jul 14, 2026 11:16pm
workbench-sveltekit-workflow Ready Ready Preview, Comment Jul 14, 2026 11:16pm
workbench-tanstack-start-workflow Ready Ready Preview, Comment Jul 14, 2026 11:16pm
workbench-vite-workflow Ready Ready Preview, Comment Jul 14, 2026 11:16pm
workflow-docs Ready Ready Preview, Comment, Open in v0 Jul 14, 2026 11:16pm
workflow-swc-playground Ready Ready Preview, Comment Jul 14, 2026 11:16pm
workflow-tarballs Ready Ready Preview, Comment Jul 14, 2026 11:16pm
workflow-web Ready Ready Preview, Comment Jul 14, 2026 11:16pm

@NathanColosimo
NathanColosimo enabled auto-merge (squash) July 14, 2026 22:47
@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

🧪 E2E Test Results

Some tests failed

Summary

Passed Failed Skipped Total
✅ ▲ Vercel Production 1077 0 78 1155
✅ 💻 Local Development 1174 0 86 1260
✅ 📦 Local Production 1174 0 86 1260
✅ 🐘 Local Postgres 1174 0 86 1260
✅ 🪟 Windows 105 0 0 105
❌ 🌍 Community Worlds 82 102 9 193
✅ 📋 Other 594 0 36 630
Total 5380 102 381 5863

❌ Failed Tests

🌍 Community Worlds (102 failed)

redis (19 failed):

  • hookWorkflow | wrun_01KXHEKY8Z3V27355GFY2QXW4X
  • hookWorkflow is not resumable via public webhook endpoint | wrun_01KXHEM663CXM1R1FAZP64EKNE
  • parallelStepsThenWebhookWorkflow - no hook_conflict from same-tick replay race | wrun_01KXHEMG6YBMCF2C17TJ0TNDJ0
  • sleepingWorkflow | wrun_01KXHENQB8WQDWT88EG71PCYHF
  • outputStreamWorkflow negative startIndex (reads from end)
  • outputStreamWorkflow - getTailIndex and getStreamChunks getTailIndex returns correct index after stream completes
  • outputStreamWorkflow - getTailIndex and getStreamChunks getTailIndex returns -1 before any chunks are written
  • outputStreamWorkflow - getTailIndex and getStreamChunks getStreamChunks returns same content as reading the stream
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously | wrun_01KXHEXYD0TATRPA9SH6GV7KK1
  • hookGetConflictWorkflow - awaiting hook.getConflict() registers hook without payload | wrun_01KXHEYCAESVKWEQ6H19HQKTJV
  • hookGetConflictThenStepParallelWorkflow - hook.getConflict() continuation step runs alongside other steps | wrun_01KXHEYMCTDMEMK3V3QSK1S264
  • hookGetConflictWorkflow - hook.getConflict() resolves with the conflicting run when token is already registered | wrun_01KXHEZ26S60A40DGF1SCE5YKY
  • hookClaimOnlyMutexWorkflow - hook works as a pure run mutex without payload data | wrun_01KXHEZXNY0B1MJDTVDKC4F54T
  • hookAdoptOwnerResultWorkflow - duplicate adopts the owner result via conflict.returnValue | wrun_01KXHF02M5B3XCH6B3EMZK7CQX
  • hookSignalOwnerWorkflow - duplicate forwards its payload to the owner via resumeHook | wrun_01KXHF09HAMS6EAT4PSS0QPEXK
  • hookSupersedeOwnerWorkflow - duplicate cancels the owner and claims the released token | wrun_01KXHF0FRHQ3G1BDGTTDKR21K9
  • resume-or-start route pattern - resumeHook retried after start() reaches the new run | wrun_01KXHF0SRMKCPB452G17ET3N0N
  • pages router sleepingWorkflow via pages router
  • resilient start: addTenWorkflow completes when run_created returns 500 | wrun_01KXHF712XFC0A3HDP0FKE8BBQ

turso (83 failed):

  • addTenWorkflow | wrun_01KXHEK06WN31QJ8X8CNXPT8DY
  • addTenWorkflow | wrun_01KXHEK06WN31QJ8X8CNXPT8DY
  • deploymentId: 'latest' is a no-op in non-Vercel worlds
  • wellKnownAgentWorkflow (.well-known/agent) | wrun_01KXHEN6X0MBPT9WHSBAVQVGMS
  • should work with react rendering in step
  • promiseAllWorkflow | wrun_01KXHEK8X194MFGKY3ZNNVY68F
  • promiseRaceWorkflow | wrun_01KXHEKCV1MX2ZFAJVCRFANSWF
  • promiseAnyWorkflow | wrun_01KXHEKF8A87ZX579R5YKNMRP4
  • importedStepOnlyWorkflow | wrun_01KXHENJHVXXT7BDTM01CPSCBQ
  • readableStreamWorkflow | wrun_01KXHEKHR0EEGJPXNKG3QK1E0H
  • hookWorkflow | wrun_01KXHEKY8Z3V27355GFY2QXW4X
  • hookWorkflow is not resumable via public webhook endpoint | wrun_01KXHEM663CXM1R1FAZP64EKNE
  • webhookWorkflow | wrun_01KXHEMASEN4B21TKNCF3Q495B
  • parallelStepsThenWebhookWorkflow - no hook_conflict from same-tick replay race | wrun_01KXHEMG6YBMCF2C17TJ0TNDJ0
  • sleepingWorkflow | wrun_01KXHENQB8WQDWT88EG71PCYHF
  • parallelSleepWorkflow | wrun_01KXHEP777316PRTNSPE04Y91A
  • sleepWinsRaceWorkflow | wrun_01KXHEPAVJ2AGE1B2J36VX48RT
  • stepWinsRaceWorkflow | wrun_01KXHEPEK98BNEMZ5CPPWAJ381
  • nullByteWorkflow | wrun_01KXHEPJ485YNJDAG1GPE97EGG
  • workflowAndStepMetadataWorkflow | wrun_01KXHEPMFY2S21BF283SQY022K
  • outputStreamWorkflow no startIndex (reads all chunks)
  • outputStreamWorkflow positive startIndex (skips first chunk)
  • outputStreamWorkflow negative startIndex (reads from end)
  • outputStreamWorkflow - getTailIndex and getStreamChunks getTailIndex returns correct index after stream completes
  • outputStreamWorkflow - getTailIndex and getStreamChunks getTailIndex returns -1 before any chunks are written
  • outputStreamWorkflow - getTailIndex and getStreamChunks getStreamChunks returns same content as reading the stream
  • outputStreamInsideStepWorkflow - getWritable() called inside step functions | wrun_01KXHES49HNSDA2NJXY4CV67P7
  • writableForwardedFromWorkflowWorkflow | wrun_01KXHESHKK3WJWDAD0FPWZJ16N
  • writableForwardedFromStepWorkflow | wrun_01KXHESNW290K514FE74R3HBJQ
  • fetchWorkflow | wrun_01KXHESSG3ZMHT32YTRRT5G8GW
  • promiseRaceStressTestWorkflow | wrun_01KXHESX4SKBTBPJ4V4123P0KW
  • error handling error propagation workflow errors nested function calls preserve message and stack trace
  • error handling error propagation workflow errors cross-file imports preserve message and stack trace
  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
  • error handling retry behavior regular Error retries until success
  • error handling retry behavior FatalError fails immediately without retries
  • error handling retry behavior RetryableError respects custom retryAfter delay
  • error handling retry behavior maxRetries=0 disables retries
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • error handling not registered WorkflowNotRegisteredError fails the run when workflow does not exist
  • error handling not registered StepNotRegisteredError fails the step but workflow can catch it
  • error handling not registered StepNotRegisteredError fails the run when not caught in workflow
  • hookCleanupTestWorkflow - hook token reuse after workflow completion | wrun_01KXHEXH0H9QX17CW7JWFWY631
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously | wrun_01KXHEXYD0TATRPA9SH6GV7KK1
  • hookGetConflictWorkflow - awaiting hook.getConflict() registers hook without payload | wrun_01KXHEYCAESVKWEQ6H19HQKTJV
  • 'hookGetConflictWithPriorStepWorkflow' - hook.getConflict() does not block step execution | wrun_01KXHEYF0HP1K7S2JVDWGYYGD4
  • 'hookGetConflictWithParallelStepWorkfl…' - hook.getConflict() does not block step execution | wrun_01KXHEYHPDK3HZPSHHTX6P7QEB
  • hookGetConflictThenStepParallelWorkflow - hook.getConflict() continuation step runs alongside other steps | wrun_01KXHEYMCTDMEMK3V3QSK1S264
  • hookGetConflictWorkflow - hook.getConflict() resolves with the conflicting run when token is already registered | wrun_01KXHEZ26S60A40DGF1SCE5YKY
  • hookClaimOnlyMutexWorkflow - hook works as a pure run mutex without payload data | wrun_01KXHEZXNY0B1MJDTVDKC4F54T
  • hookAdoptOwnerResultWorkflow - duplicate adopts the owner result via conflict.returnValue | wrun_01KXHF02M5B3XCH6B3EMZK7CQX
  • hookSignalOwnerWorkflow - duplicate forwards its payload to the owner via resumeHook | wrun_01KXHF09HAMS6EAT4PSS0QPEXK
  • hookSupersedeOwnerWorkflow - duplicate cancels the owner and claims the released token | wrun_01KXHF0FRHQ3G1BDGTTDKR21K9
  • resume-or-start route pattern - resumeHook retried after start() reaches the new run | wrun_01KXHF0SRMKCPB452G17ET3N0N
  • hookDisposeTestWorkflow - hook token reuse after explicit disposal while workflow still running | wrun_01KXHF111RYBYQ7SH6CT80HJFW
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars) | wrun_01KXHF1J68Y9B5EER5MTN2XCWR
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument | wrun_01KXHF1WBNC7E3J0HRT5DE3S06
  • closureVariableWorkflow - nested step functions with closure variables | wrun_01KXHF22FB29GZ6RKX5QJK3G9N
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step | wrun_01KXHF24X27PH1ZTCKGWBWWM4G
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • health check (CLI) - workflow health command reports healthy endpoints
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly | wrun_01KXHF2NAJRKGVV5E6M5N7N9VQ
  • Calculator.calculate - static workflow method using static step methods from another class | wrun_01KXHF2VW65TDQHJ5Y3WKDSP67
  • AllInOneService.processNumber - static workflow method using sibling static step methods | wrun_01KXHF33B47HMR8FHGJ6RS0T10
  • ChainableService.processWithThis - static step methods using this to reference the class | wrun_01KXHF3ATG14ZAHJND9X74Q53Z
  • thisSerializationWorkflow - step function invoked with .call() and .apply() | wrun_01KXHF3J9RFVQ8A11432VSS5T8
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE | wrun_01KXHF3SPHJ0BG8W754YRFJ21P
  • instanceMethodStepWorkflow - instance methods with "use step" directive | wrun_01KXHF41BWBFMF6S115F80SKXE
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context | wrun_01KXHF4FKKWYWYC2BTA84MDV2Z
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument | wrun_01KXHF4S7T6Z12RM6NQRJ7M0V5
  • cancelRun - cancelling a running workflow | wrun_01KXHF50HXYW7WX7H03S4V00G4
  • cancelRun via CLI - cancelling a running workflow | wrun_01KXHF55V9D52023GBHV05MCYR
  • pages router addTenWorkflow via pages router
  • pages router promiseAllWorkflow via pages router
  • pages router sleepingWorkflow via pages router
  • hookWithSleepWorkflow - hook payloads delivered correctly with concurrent sleep | wrun_01KXHF5EXCS7GETSHFHJRVWVSV
  • hookWithSleepFinalStepWorkflow - step only on final payload | wrun_01KXHF5Y7MM8N3B8VJ13C9JTMW
  • sleepInLoopWorkflow - sleep inside loop with steps actually delays each iteration | wrun_01KXHF682EYKGHTK96HR9SG1QQ
  • sleepWithSequentialStepsWorkflow - sequential steps work with concurrent sleep (control) | wrun_01KXHF6MJ5T92TK64Y9G60PHT0
  • importMetaUrlWorkflow - import.meta.url is available in step bundles | wrun_01KXHF6VVW1B7N5DEC0V1BQ4GR
  • metadataFromHelperWorkflow - getWorkflowMetadata/getStepMetadata work from module-level helper (#1577) | wrun_01KXHF6YNXM7VR30FPWGKADB9V
  • resilient start: addTenWorkflow completes when run_created returns 500 | wrun_01KXHF712XFC0A3HDP0FKE8BBQ

Details by Category

✅ ▲ Vercel Production
App Passed Failed Skipped
✅ astro 97 0 8
✅ example 97 0 8
✅ express 97 0 8
✅ fastify 97 0 8
✅ hono 97 0 8
✅ nextjs-turbopack 102 0 3
✅ nextjs-webpack 102 0 3
✅ nitro 97 0 8
✅ nuxt 97 0 8
✅ sveltekit 97 0 8
✅ vite 97 0 8
✅ 💻 Local Development
App Passed Failed Skipped
✅ astro-stable 99 0 6
✅ express-stable 99 0 6
✅ fastify-stable 99 0 6
✅ hono-stable 99 0 6
✅ nextjs-turbopack-canary 86 0 19
✅ nextjs-turbopack-stable 105 0 0
✅ nextjs-webpack-canary 86 0 19
✅ nextjs-webpack-stable 105 0 0
✅ nitro-stable 99 0 6
✅ nuxt-stable 99 0 6
✅ sveltekit-stable 99 0 6
✅ vite-stable 99 0 6
✅ 📦 Local Production
App Passed Failed Skipped
✅ astro-stable 99 0 6
✅ express-stable 99 0 6
✅ fastify-stable 99 0 6
✅ hono-stable 99 0 6
✅ nextjs-turbopack-canary 86 0 19
✅ nextjs-turbopack-stable 105 0 0
✅ nextjs-webpack-canary 86 0 19
✅ nextjs-webpack-stable 105 0 0
✅ nitro-stable 99 0 6
✅ nuxt-stable 99 0 6
✅ sveltekit-stable 99 0 6
✅ vite-stable 99 0 6
✅ 🐘 Local Postgres
App Passed Failed Skipped
✅ astro-stable 99 0 6
✅ express-stable 99 0 6
✅ fastify-stable 99 0 6
✅ hono-stable 99 0 6
✅ nextjs-turbopack-canary 86 0 19
✅ nextjs-turbopack-stable 105 0 0
✅ nextjs-webpack-canary 86 0 19
✅ nextjs-webpack-stable 105 0 0
✅ nitro-stable 99 0 6
✅ nuxt-stable 99 0 6
✅ sveltekit-stable 99 0 6
✅ vite-stable 99 0 6
✅ 🪟 Windows
App Passed Failed Skipped
✅ nextjs-turbopack 105 0 0
❌ 🌍 Community Worlds
App Passed Failed Skipped
✅ mongodb-dev 4 0 3
✅ redis-dev 4 0 3
❌ redis 67 19 0
✅ turso-dev 4 0 3
❌ turso 3 83 0
✅ 📋 Other
App Passed Failed Skipped
✅ e2e-local-dev-nest-stable 99 0 6
✅ e2e-local-dev-tanstack-start-stable 99 0 6
✅ e2e-local-postgres-nest-stable 99 0 6
✅ e2e-local-postgres-tanstack-start-stable 99 0 6
✅ e2e-local-prod-nest-stable 99 0 6
✅ e2e-local-prod-tanstack-start-stable 99 0 6

📋 View full workflow run

@TooTallNate TooTallNate left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 same workflowBuildDir → whole-buildDir exclusion 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: join from 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 the viteWorkflow import 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants