Skip to content

Backport #4370: fix(vite): rebuild workflows once per change, not per environment - #4385

Merged
VaguelySerious merged 3 commits into
stablefrom
backport/pr-4370-to-stable
Sep 30, 2026
Merged

VaguelySerious merged 3 commits into
stablefrom
backport/pr-4370-to-stable

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Automated backport of #4370 to stable (backport job run).

AI recommendation: This is a bug fix to workflowHotUpdatePlugin, which exists on stable (verified packages/vite/src/hot-update.ts is present there without the dedup logic), where Vite's per-environment hotUpdate calls triggered 2-3 full workflow rebuilds per file change, stalling HMR and making dev/e2e tests flaky. It carries a patch changeset, adds no new API surface or options, and the only other changes are a test file plus the test script/vitest devDependency needed to run it — test and build plumbing rather than feature work.

Merge conflicts were resolved by AI (opencode with anthropic/claude-opus-5). Please review the conflict resolution carefully before merging.

)

Vite calls hotUpdate once per environment (client, ssr, and any a
framework adds, such as Nitro's) for each file change. The plugin
rebuilt every workflow on each call, so a single edit cost two to three
full rebuilds, run back to back before Vite sent any HMR update.

Remember each change by (timestamp, file), which Vite shares across a
change's environment calls, and skip the repeats.

Signed-off-by: Alex Langenfeld <alex.langenfeld@vercel.com>
@changeset-bot

changeset-bot Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d8eeaa0

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

This PR includes changesets to release 16 packages
Name Type
@workflow/vite Patch
@workflow/astro Patch
@workflow/nitro Patch
@workflow/sveltekit Patch
workflow Patch
@workflow/nuxt 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/nest Patch
@workflow/rollup 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 Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated
example-nextjs-workflow-turbopack Ready Ready Preview, v0 Sep 30, 2026 9:21pm UTC
example-nextjs-workflow-webpack Ready Ready Preview, v0 Sep 30, 2026 9:21pm UTC
example-workflow Ready Ready Preview, v0 Sep 30, 2026 9:21pm UTC
workbench-astro-workflow Ready Ready Preview, v0 Sep 30, 2026 9:21pm UTC
workbench-express-workflow Ready Ready Preview, v0 Sep 30, 2026 9:21pm UTC
workbench-fastify-workflow Ready Ready Preview, v0 Sep 30, 2026 9:21pm UTC
workbench-hono-workflow Ready Ready Preview, v0 Sep 30, 2026 9:21pm UTC
workbench-nestjs-workflow Ready Ready Preview, v0 Sep 30, 2026 9:21pm UTC
workbench-nitro-workflow Ready Ready Preview, v0 Sep 30, 2026 9:21pm UTC
workbench-nuxt-workflow Ready Ready Preview, v0 Sep 30, 2026 9:21pm UTC
workbench-python-workflow Error Error v0 Sep 30, 2026 9:21pm UTC
workbench-sveltekit-workflow Ready Ready Preview, v0 Sep 30, 2026 9:21pm UTC
workbench-tanstack-start-workflow Ready Ready Preview, v0 Sep 30, 2026 9:21pm UTC
workbench-vite-workflow Ready Ready Preview, v0 Sep 30, 2026 9:21pm UTC
workflow-swc-playground Ready Ready Preview, v0 Sep 30, 2026 9:21pm UTC
workflow-tarballs Ready Ready Preview, v0 Sep 30, 2026 9:21pm UTC
workflow-web Ready Ready Preview, v0 Sep 30, 2026 9:21pm UTC
1 Skipped Deployment
Project Deployment Actions Updated
workflow-docs Skipped Skipped v0 Sep 30, 2026 9:21pm UTC

@github-actions

github-actions Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor Author

🧪 E2E Test Results

❌ Some tests failed

Summary

Passed Failed Skipped Total
✅ ▲ Vercel Production 1099 0 78 1177
✅ 💻 Local Development 1198 0 86 1284
✅ 📦 Local Production 1198 0 86 1284
✅ 🐘 Local Postgres 1198 0 86 1284
✅ 🪟 Windows 107 0 0 107
❌ 🌍 Community Worlds 82 106 9 197
✅ 📋 Other 606 0 36 642
Total 5488 106 381 5975

❌ Failed Tests

🌍 Community Worlds (106 failed)

redis (21 failed):

  • hookWorkflow | wrun_01M3T2Z4TZRRHAF4EETSMA8KCA
  • hookWorkflow is not resumable via public webhook endpoint | wrun_01M3T2ZCKSB01F82KQRJKA7002
  • parallelStepsThenWebhookWorkflow - no hook_conflict from same-tick replay race | wrun_01M3T2ZPA8Q9109FNP17692B87
  • sleepingWorkflow | wrun_01M3T30KAQQY24C1TM37BZ9ER2
  • 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
  • error handling serialization failures step-argument serialization failure is catchable in workflow code
  • error handling serialization failures uncaught step-argument serialization failure fails the run as USER_ERROR without redelivery retries
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously | wrun_01M3T38V14E57M99K37CWAYT6P
  • hookGetConflictWorkflow - awaiting hook.getConflict() registers hook without payload | wrun_01M3T397HESE21NTA3D2TK2KGN
  • hookGetConflictThenStepParallelWorkflow - hook.getConflict() continuation step runs alongside other steps | wrun_01M3T39EXXB1FTXXAE8T5BXJJX
  • hookGetConflictWorkflow - hook.getConflict() resolves with the conflicting run when token is already registered | wrun_01M3T39VX3PRQVPZA8T44W2AZR
  • hookClaimOnlyMutexWorkflow - hook works as a pure run mutex without payload data | wrun_01M3T3AQ0JXTK7D1ADDXFECF96
  • hookAdoptOwnerResultWorkflow - duplicate adopts the owner result via conflict.returnValue | wrun_01M3T3AVMT9BF7A77ABHXATD53
  • hookSignalOwnerWorkflow - duplicate forwards its payload to the owner via resumeHook | wrun_01M3T3AZPKR85WFV87K23YXFVJ
  • hookSupersedeOwnerWorkflow - duplicate cancels the owner and claims the released token | wrun_01M3T3B36WN79ZND69PYXBHM3Z
  • resume-or-start route pattern - resumeHook retried after start() reaches the new run | wrun_01M3T3BBTZD0ZSVE1PRZ3YS2CV
  • pages router sleepingWorkflow via pages router
  • resilient start: addTenWorkflow completes when run_created returns 500 | wrun_01M3T3GYWKR30MAXMTK62KGJTY

turso (85 failed):

  • addTenWorkflow | wrun_01M3T2Y77Q4M105Z1WVVVDKG8Y
  • addTenWorkflow | wrun_01M3T2Y77Q4M105Z1WVVVDKG8Y
  • deploymentId: 'latest' is a no-op in non-Vercel worlds
  • wellKnownAgentWorkflow (.well-known/agent) | wrun_01M3T2YJT1KHCTPS4WT6N6PW08
  • should work with react rendering in step
  • promiseAllWorkflow | wrun_01M3T2YEGKA0J9YDPG0Y95M2ES
  • promiseRaceWorkflow | wrun_01M3T2YK4XPV92TTCJYYEA7DQV
  • promiseAnyWorkflow | wrun_01M3T2YNCFRFZBD960A877MD93
  • importedStepOnlyWorkflow | wrun_01M3T2YX209XY7608QDH7NNAC4
  • readableStreamWorkflow | wrun_01M3T2YQKKATP4XB995TG7RJFR
  • hookWorkflow | wrun_01M3T2Z4TZRRHAF4EETSMA8KCA
  • hookWorkflow is not resumable via public webhook endpoint | wrun_01M3T2ZCKSB01F82KQRJKA7002
  • webhookWorkflow | wrun_01M3T2ZH7DTSQM2KHNRXEX9WYJ
  • parallelStepsThenWebhookWorkflow - no hook_conflict from same-tick replay race | wrun_01M3T2ZPA8Q9109FNP17692B87
  • sleepingWorkflow | wrun_01M3T30KAQQY24C1TM37BZ9ER2
  • parallelSleepWorkflow | wrun_01M3T313Q6R0REPKZ7D7HE06FX
  • sleepWinsRaceWorkflow | wrun_01M3T31799A9HC8VY318FTFQ40
  • stepWinsRaceWorkflow | wrun_01M3T31AMCVQFTQ1YGZRSGCA0N
  • nullByteWorkflow | wrun_01M3T31DZ9WE25MM3XF07781JN
  • workflowAndStepMetadataWorkflow | wrun_01M3T31G8ZZ9DHY5PSFMQ93PHR
  • 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_01M3T33SKSY0D22NKKYR2M8974
  • writableForwardedFromWorkflowWorkflow | wrun_01M3T3469PAHFZ07VXV2BQDJGB
  • writableForwardedFromStepWorkflow | wrun_01M3T34A1D5CZBDZJ9XYC02529
  • fetchWorkflow | wrun_01M3T34CPZSSZR6R6PZ713GXF3
  • promiseRaceStressTestWorkflow | wrun_01M3T34G3SWJ5B1P1MKBAFHBG8
  • 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 serialization failures step-argument serialization failure is catchable in workflow code
  • error handling serialization failures uncaught step-argument serialization failure fails the run as USER_ERROR without redelivery retries
  • 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_01M3T38EH5A96D2PE1PJ3KHJMY
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously | wrun_01M3T38V14E57M99K37CWAYT6P
  • hookGetConflictWorkflow - awaiting hook.getConflict() registers hook without payload | wrun_01M3T397HESE21NTA3D2TK2KGN
  • 'hookGetConflictWithPriorStepWorkflow' - hook.getConflict() does not block step execution | wrun_01M3T399TGE9HA4YEV75MMX9WM
  • 'hookGetConflictWithParallelStepWorkfl…' - hook.getConflict() does not block step execution | wrun_01M3T39CBGB9S2RBJQR8F9DVEP
  • hookGetConflictThenStepParallelWorkflow - hook.getConflict() continuation step runs alongside other steps | wrun_01M3T39EXXB1FTXXAE8T5BXJJX
  • hookGetConflictWorkflow - hook.getConflict() resolves with the conflicting run when token is already registered | wrun_01M3T39VX3PRQVPZA8T44W2AZR
  • hookClaimOnlyMutexWorkflow - hook works as a pure run mutex without payload data | wrun_01M3T3AQ0JXTK7D1ADDXFECF96
  • hookAdoptOwnerResultWorkflow - duplicate adopts the owner result via conflict.returnValue | wrun_01M3T3AVMT9BF7A77ABHXATD53
  • hookSignalOwnerWorkflow - duplicate forwards its payload to the owner via resumeHook | wrun_01M3T3AZPKR85WFV87K23YXFVJ
  • hookSupersedeOwnerWorkflow - duplicate cancels the owner and claims the released token | wrun_01M3T3B36WN79ZND69PYXBHM3Z
  • resume-or-start route pattern - resumeHook retried after start() reaches the new run | wrun_01M3T3BBTZD0ZSVE1PRZ3YS2CV
  • hookDisposeTestWorkflow - hook token reuse after explicit disposal while workflow still running | wrun_01M3T3BJ8V9KGRVN2BFTTXW91N
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars) | wrun_01M3T3C1P1B8JX1X9732MHX2AW
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument | wrun_01M3T3CB88H3EJNWXJKXNJ1P69
  • closureVariableWorkflow - nested step functions with closure variables | wrun_01M3T3CGSVPB6FDN1XT1QJA46H
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step | wrun_01M3T3CJVYBDV73QEBXFTVGHG0
  • 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_01M3T3D2R9BNSPGA9SH25MYXFE
  • Calculator.calculate - static workflow method using static step methods from another class | wrun_01M3T3D8BQPQ81GJ4ZPZXVQMPD
  • AllInOneService.processNumber - static workflow method using sibling static step methods | wrun_01M3T3DEX1H4V83WZHQC9E4XWY
  • ChainableService.processWithThis - static step methods using this to reference the class | wrun_01M3T3DNBQA34SV6XM0KM1M9RX
  • thisSerializationWorkflow - step function invoked with .call() and .apply() | wrun_01M3T3DVYAXXF08076VKR50YZK
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE | wrun_01M3T3E2T4NV8WGVH0TJMVZCAZ
  • instanceMethodStepWorkflow - instance methods with "use step" directive | wrun_01M3T3E9DZZW8MV237W0X276D4
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context | wrun_01M3T3ENNC23C4PQVY3QZN950J
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument | wrun_01M3T3EXF46FR9KR1912T9RXBP
  • cancelRun - cancelling a running workflow | wrun_01M3T3F40HNKJM6EEXZ3AQFFE8
  • cancelRun via CLI - cancelling a running workflow | wrun_01M3T3F943E36AA6TJ87TCBPDW
  • 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_01M3T3FGP27N6D2FRK5RKP8S2R
  • hookWithSleepFinalStepWorkflow - step only on final payload | wrun_01M3T3FWGHM1SWXKS0NRFGN73R
  • sleepInLoopWorkflow - sleep inside loop with steps actually delays each iteration | wrun_01M3T3G53DHMGS82SK4Y5N2WTH
  • sleepWithSequentialStepsWorkflow - sequential steps work with concurrent sleep (control) | wrun_01M3T3GJX1HTQ3VSB17JSF8REH
  • importMetaUrlWorkflow - import.meta.url is available in step bundles | wrun_01M3T3GTF1YJ5PHT8RJGQXYVTA
  • metadataFromHelperWorkflow - getWorkflowMetadata/getStepMetadata work from module-level helper (#1577) | wrun_01M3T3GWJ50PKRBSXTMDVJKW12
  • resilient start: addTenWorkflow completes when run_created returns 500 | wrun_01M3T3GYWKR30MAXMTK62KGJTY

Details by Category

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

📋 View full workflow run

The backport carried main's jsdom@26.1.0(supports-color@10.2.2) peer
suffix, which has no snapshot on stable, so frozen installs failed with
ERR_PNPM_LOCKFILE_MISSING_DEPENDENCY.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel
vercel Bot temporarily deployed to Preview – workflow-docs September 30, 2026 21:16 Inactive
@VaguelySerious
VaguelySerious merged commit 986e3e7 into stable Sep 30, 2026
96 of 100 checks passed
@VaguelySerious
VaguelySerious deleted the backport/pr-4370-to-stable branch September 30, 2026 21:42

This branch had an error being deployed

17 failed (outdated) and 1 inactive deployments
Preview – workflow-docs — d8eeaa0b Deployed Sep 30, 2026 by vercel[bot]
Preview – workflow-swc-playground — 88f185b5 Deployed Sep 24, 2026 by vercel[bot]
Preview – workflow-web — 88f185b5 Deployed Sep 24, 2026 by vercel[bot]
Preview – workbench-nuxt-workflow — 88f185b5 Deployed Sep 24, 2026 by vercel[bot]
Preview – workbench-vite-workflow — 88f185b5 Deployed Sep 24, 2026 by vercel[bot]
Preview – workbench-astro-workflow — 88f185b5 Deployed Sep 24, 2026 by vercel[bot]
Preview – example-nextjs-workflow-turbopack — 88f185b5 Deployed Sep 24, 2026 by vercel[bot]
Preview – workflow-tarballs — 88f185b5 Deployed Sep 24, 2026 by vercel[bot]
Preview – workbench-sveltekit-workflow — 88f185b5 Deployed Sep 24, 2026 by vercel[bot]
Preview – example-nextjs-workflow-webpack — 88f185b5 Deployed Sep 24, 2026 by vercel[bot]
Preview – workbench-nestjs-workflow — 88f185b5 Deployed Sep 24, 2026 by vercel[bot]
Preview – workbench-hono-workflow — 88f185b5 Deployed Sep 24, 2026 by vercel[bot]
Preview – example-workflow — 88f185b5 Deployed Sep 24, 2026 by vercel[bot]
Preview – workbench-nitro-workflow — 88f185b5 Deployed Sep 24, 2026 by vercel[bot]
Preview – workbench-fastify-workflow — 88f185b5 Deployed Sep 24, 2026 by vercel[bot]
Preview – workbench-tanstack-start-workflow — 88f185b5 Deployed Sep 24, 2026 by vercel[bot]
Preview – workbench-express-workflow — 88f185b5 Deployed Sep 24, 2026 by vercel[bot]
Preview – workbench-python-workflow — 88f185b5 Deployed Sep 24, 2026 by vercel[bot]
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.

1 participant