Skip to content

Backport #2351: [vitest] Fix local imports failing to load in test step bundles#2542

Merged
VaguelySerious merged 3 commits into
stablefrom
backport/pr-2351-to-stable
Jun 22, 2026
Merged

Backport #2351: [vitest] Fix local imports failing to load in test step bundles#2542
VaguelySerious merged 3 commits into
stablefrom
backport/pr-2351-to-stable

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

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

AI recommendation: This is a bug fix for the vitest builder externalizing project-local step imports, and the PR body explicitly states the stable channel is affected (the .ts.js rewrite, present on stable via rewriteTsExtensions: true, makes every externalized local import fail). The fix relies on the bundleTransitiveLocalStepDependencies option, which already exists on stable (in packages/builders and packages/nitro), so it does not depend on main-only behavior; the only difference is that stable uses the older createWorkflowsBundle/createStepsBundle API, which is a conflict-resolution concern rather than a reason against backporting.

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

Signed-off-by: Peter Wielander <mittgfu@gmail.com>
@changeset-bot

changeset-bot Bot commented Jun 20, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: fa38294

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

This PR includes changesets to release 1 package
Name Type
@workflow/vitest 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 Jun 20, 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 Jun 22, 2026 6:17pm
example-nextjs-workflow-webpack Ready Ready Preview, Comment Jun 22, 2026 6:17pm
example-workflow Ready Ready Preview, Comment Jun 22, 2026 6:17pm
workbench-astro-workflow Ready Ready Preview, Comment Jun 22, 2026 6:17pm
workbench-express-workflow Ready Ready Preview, Comment Jun 22, 2026 6:17pm
workbench-fastify-workflow Ready Ready Preview, Comment Jun 22, 2026 6:17pm
workbench-hono-workflow Ready Ready Preview, Comment Jun 22, 2026 6:17pm
workbench-nitro-workflow Ready Ready Preview, Comment Jun 22, 2026 6:17pm
workbench-nuxt-workflow Ready Ready Preview, Comment Jun 22, 2026 6:17pm
workbench-sveltekit-workflow Ready Ready Preview, Comment Jun 22, 2026 6:17pm
workbench-tanstack-start-workflow Ready Ready Preview, Comment Jun 22, 2026 6:17pm
workbench-vite-workflow Ready Ready Preview, Comment Jun 22, 2026 6:17pm
workflow-swc-playground Ready Ready Preview, Comment Jun 22, 2026 6:17pm
workflow-tarballs Ready Ready Preview, Comment Jun 22, 2026 6:17pm
workflow-web Ready Ready Preview, Comment Jun 22, 2026 6:17pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
workflow-docs Skipped Skipped Jun 22, 2026 6:17pm

@github-actions

github-actions Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor Author

🧪 E2E Test Results

Some tests failed

Summary

Passed Failed Skipped Total
❌ ▲ Vercel Production 1043 1 78 1122
✅ 💻 Local Development 1138 0 86 1224
✅ 📦 Local Production 1138 0 86 1224
✅ 🐘 Local Postgres 1126 0 98 1224
✅ 🪟 Windows 102 0 0 102
❌ 🌍 Community Worlds 77 98 6 181
✅ 📋 Other 574 0 38 612
Total 5198 99 392 5689

❌ Failed Tests

▲ Vercel Production (1 failed)

vite (1 failed):

🌍 Community Worlds (98 failed)

redis (18 failed):

  • hookWorkflow is not resumable via public webhook endpoint | wrun_01KVR8PCVAR40BJT3735AXNR4B
  • parallelStepsThenWebhookWorkflow - no hook_conflict from same-tick replay race | wrun_01KVR8T75ZS9QMV2S03R6N6CSG
  • sleepingWorkflow | wrun_01KVR8VF9JHQSQBHXESZWC4ZRM
  • 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_01KVR93P9EZN3BKJ43Y02AP335
  • hookGetConflictWorkflow - awaiting hook.getConflict() registers hook without payload | wrun_01KVR942XJR35WB44E7FBFRK5T
  • hookGetConflictThenStepParallelWorkflow - hook.getConflict() continuation step runs alongside other steps | wrun_01KVR94AKNS5QSN0CWF2B2CFYS
  • hookGetConflictWorkflow - hook.getConflict() resolves with the conflicting run when token is already registered | wrun_01KVR94R7SSSMVFNXV158PCENV
  • hookClaimOnlyMutexWorkflow - hook works as a pure run mutex without payload data | wrun_01KVR95KW1AF4EKZK9Y7BRM6MK
  • hookAdoptOwnerResultWorkflow - duplicate adopts the owner result via conflict.returnValue | wrun_01KVR95SA1J3HZHXTFW62S7XHZ
  • hookSignalOwnerWorkflow - duplicate forwards its payload to the owner via resumeHook | wrun_01KVR95ZS25RGBQB8JW48JX06T
  • hookSupersedeOwnerWorkflow - duplicate cancels the owner and claims the released token | wrun_01KVR967EWQWQ07VC9HYQRKQ7F
  • resume-or-start route pattern - resumeHook retried after start() reaches the new run | wrun_01KVR96H6QD906VCZ8W2A0XPG9
  • pages router sleepingWorkflow via pages router
  • resilient start: addTenWorkflow completes when run_created returns 500 | wrun_01KVR9CYJ22MHFBAQ30K9BE5X3

turso (80 failed):

  • addTenWorkflow | wrun_01KVR8N33H0N77YN2NKGZET1HR
  • addTenWorkflow | wrun_01KVR8N33H0N77YN2NKGZET1HR
  • deploymentId: 'latest' is a no-op in non-Vercel worlds
  • wellKnownAgentWorkflow (.well-known/agent) | wrun_01KVR8PC8WE2S5FHPN5T5Z211G
  • should work with react rendering in step
  • promiseAllWorkflow | wrun_01KVR8NBBZ9RPXCSB0KDXP53HM
  • promiseRaceWorkflow | wrun_01KVR8NH2V2H89TZWSJX4QSKD0
  • promiseAnyWorkflow | wrun_01KVR8NMH25QR1FENCJRHEM48W
  • importedStepOnlyWorkflow | wrun_01KVR8PRJJDFSY0NJWFFFZT24J
  • readableStreamWorkflow | wrun_01KVR8NPYN7E4RXMVDNR2PYYY1
  • hookWorkflow | wrun_01KVR8P47HDNDJEDNV8KQDGS7R
  • hookWorkflow is not resumable via public webhook endpoint | wrun_01KVR8PCVAR40BJT3735AXNR4B
  • webhookWorkflow | wrun_01KVR8PHDFZM6HAYNQAJPJQJYX
  • parallelStepsThenWebhookWorkflow - no hook_conflict from same-tick replay race | wrun_01KVR8T75ZS9QMV2S03R6N6CSG
  • sleepingWorkflow | wrun_01KVR8VF9JHQSQBHXESZWC4ZRM
  • parallelSleepWorkflow | wrun_01KVR8VYJWBZYJQVC982CC4V8J
  • nullByteWorkflow | wrun_01KVR8W3MMAWE84WW3T3TVKGYT
  • workflowAndStepMetadataWorkflow | wrun_01KVR8W75TMK3E00T3RJRPQ9Y4
  • 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_01KVR8YPF8J2D3HR0HD85F511D
  • writableForwardedFromWorkflowWorkflow | wrun_01KVR8Z8ADYE697NBMFY4EY6FV
  • writableForwardedFromStepWorkflow | wrun_01KVR8ZCPF25BYT5FWK03ST882
  • fetchWorkflow | wrun_01KVR8ZGEAKY35YWQKYA3JTSRR
  • promiseRaceStressTestWorkflow | wrun_01KVR8ZN3X4G9V9P9DYY3NE42Z
  • 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_01KVR937YCJ9ANSERD48NNP6X6
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously | wrun_01KVR93P9EZN3BKJ43Y02AP335
  • hookGetConflictWorkflow - awaiting hook.getConflict() registers hook without payload | wrun_01KVR942XJR35WB44E7FBFRK5T
  • 'hookGetConflictWithPriorStepWorkflow' - hook.getConflict() does not block step execution | wrun_01KVR945F7B96F30M045R36AQM
  • 'hookGetConflictWithParallelStepWorkfl…' - hook.getConflict() does not block step execution | wrun_01KVR947WSR2P1DPNBG5W7CWRR
  • hookGetConflictThenStepParallelWorkflow - hook.getConflict() continuation step runs alongside other steps | wrun_01KVR94AKNS5QSN0CWF2B2CFYS
  • hookGetConflictWorkflow - hook.getConflict() resolves with the conflicting run when token is already registered | wrun_01KVR94R7SSSMVFNXV158PCENV
  • hookClaimOnlyMutexWorkflow - hook works as a pure run mutex without payload data | wrun_01KVR95KW1AF4EKZK9Y7BRM6MK
  • hookAdoptOwnerResultWorkflow - duplicate adopts the owner result via conflict.returnValue | wrun_01KVR95SA1J3HZHXTFW62S7XHZ
  • hookSignalOwnerWorkflow - duplicate forwards its payload to the owner via resumeHook | wrun_01KVR95ZS25RGBQB8JW48JX06T
  • hookSupersedeOwnerWorkflow - duplicate cancels the owner and claims the released token | wrun_01KVR967EWQWQ07VC9HYQRKQ7F
  • resume-or-start route pattern - resumeHook retried after start() reaches the new run | wrun_01KVR96H6QD906VCZ8W2A0XPG9
  • hookDisposeTestWorkflow - hook token reuse after explicit disposal while workflow still running | wrun_01KVR96SXNMRJQJXJN7Z28QRTJ
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars) | wrun_01KVR97B6TSEDWJWVKTSV40CPR
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument | wrun_01KVR97N51H6X3F5EPB8AV6YCE
  • closureVariableWorkflow - nested step functions with closure variables | wrun_01KVR97X943V4TBPCTKGAWGZNC
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step | wrun_01KVR9810EAXY879RKFWHTBXMD
  • 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_01KVR98KWRZ6RPPH635QTBNEJG
  • Calculator.calculate - static workflow method using static step methods from another class | wrun_01KVR98V8XKCHTW8K4HKE4TF23
  • AllInOneService.processNumber - static workflow method using sibling static step methods | wrun_01KVR99291HTYFDMMFEF5ZSVMN
  • ChainableService.processWithThis - static step methods using this to reference the class | wrun_01KVR99B0J0Z6P438SWADD0D35
  • thisSerializationWorkflow - step function invoked with .call() and .apply() | wrun_01KVR99HZ2KHZ7480BB1DD9RM7
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE | wrun_01KVR99T358HKPNXE68DGJVC20
  • instanceMethodStepWorkflow - instance methods with "use step" directive | wrun_01KVR9A1VBN13QS93EEPGFS55F
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context | wrun_01KVR9AFGVYEC11KX5HDFFXBQD
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument | wrun_01KVR9AT121AQAJDW6V27G61N1
  • cancelRun - cancelling a running workflow | wrun_01KVR9B20JPEGRB1NKPVN88EXD
  • cancelRun via CLI - cancelling a running workflow | wrun_01KVR9BBAT6MJ2A6CCH1FX2J15
  • 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_01KVR9BR8039W2GJA1T4E0G4P1
  • sleepInLoopWorkflow - sleep inside loop with steps actually delays each iteration | wrun_01KVR9C8VSDT6BYZZZHBB90C70
  • sleepWithSequentialStepsWorkflow - sequential steps work with concurrent sleep (control) | wrun_01KVR9CKBJDZ4T56FFW4HQQAYY
  • importMetaUrlWorkflow - import.meta.url is available in step bundles | wrun_01KVR9CT49D1MTXXM922AWEQVT
  • metadataFromHelperWorkflow - getWorkflowMetadata/getStepMetadata work from module-level helper (#1577) | wrun_01KVR9CWA1K4H6FRDAJJJENYR6
  • resilient start: addTenWorkflow completes when run_created returns 500 | wrun_01KVR9CYJ22MHFBAQ30K9BE5X3

Details by Category

❌ ▲ Vercel Production
App Passed Failed Skipped
✅ astro 94 0 8
✅ example 94 0 8
✅ express 94 0 8
✅ fastify 94 0 8
✅ hono 94 0 8
✅ nextjs-turbopack 99 0 3
✅ nextjs-webpack 99 0 3
✅ nitro 94 0 8
✅ nuxt 94 0 8
✅ sveltekit 94 0 8
❌ vite 93 1 8
✅ 💻 Local Development
App Passed Failed Skipped
✅ astro-stable 96 0 6
✅ express-stable 96 0 6
✅ fastify-stable 96 0 6
✅ hono-stable 96 0 6
✅ nextjs-turbopack-canary 83 0 19
✅ nextjs-turbopack-stable 102 0 0
✅ nextjs-webpack-canary 83 0 19
✅ nextjs-webpack-stable 102 0 0
✅ nitro-stable 96 0 6
✅ nuxt-stable 96 0 6
✅ sveltekit-stable 96 0 6
✅ vite-stable 96 0 6
✅ 📦 Local Production
App Passed Failed Skipped
✅ astro-stable 96 0 6
✅ express-stable 96 0 6
✅ fastify-stable 96 0 6
✅ hono-stable 96 0 6
✅ nextjs-turbopack-canary 83 0 19
✅ nextjs-turbopack-stable 102 0 0
✅ nextjs-webpack-canary 83 0 19
✅ nextjs-webpack-stable 102 0 0
✅ nitro-stable 96 0 6
✅ nuxt-stable 96 0 6
✅ sveltekit-stable 96 0 6
✅ vite-stable 96 0 6
✅ 🐘 Local Postgres
App Passed Failed Skipped
✅ astro-stable 95 0 7
✅ express-stable 95 0 7
✅ fastify-stable 95 0 7
✅ hono-stable 95 0 7
✅ nextjs-turbopack-canary 82 0 20
✅ nextjs-turbopack-stable 101 0 1
✅ nextjs-webpack-canary 82 0 20
✅ nextjs-webpack-stable 101 0 1
✅ nitro-stable 95 0 7
✅ nuxt-stable 95 0 7
✅ sveltekit-stable 95 0 7
✅ vite-stable 95 0 7
✅ 🪟 Windows
App Passed Failed Skipped
✅ nextjs-turbopack 102 0 0
❌ 🌍 Community Worlds
App Passed Failed Skipped
✅ mongodb-dev 3 0 2
✅ redis-dev 3 0 2
❌ redis 65 18 0
✅ turso-dev 3 0 2
❌ turso 3 80 0
✅ 📋 Other
App Passed Failed Skipped
✅ e2e-local-dev-nest-stable 96 0 6
✅ e2e-local-dev-tanstack-start-stable 96 0 6
✅ e2e-local-postgres-nest-stable 95 0 7
✅ e2e-local-postgres-tanstack-start-stable 95 0 7
✅ e2e-local-prod-nest-stable 96 0 6
✅ e2e-local-prod-tanstack-start-stable 96 0 6

📋 View full workflow run


Some E2E test jobs failed:

  • Vercel Prod: failure
  • Local Dev: success
  • Local Prod: success
  • Local Postgres: success
  • Windows: success

Check the workflow run for details.

On stable the vitest plugin emits the step bundle as `steps.mjs`; the
backported test read `__step_registrations.mjs` (main's filename), so it
crashed with ENOENT before asserting anything.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel vercel Bot temporarily deployed to Preview – workflow-docs June 22, 2026 18:13 Inactive
@VaguelySerious VaguelySerious disabled auto-merge June 22, 2026 18:30
@VaguelySerious VaguelySerious merged commit 2783ae3 into stable Jun 22, 2026
90 of 95 checks passed
@VaguelySerious VaguelySerious deleted the backport/pr-2351-to-stable branch June 22, 2026 18:31
@github-actions github-actions Bot mentioned this pull request Jun 22, 2026
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