Skip to content

Backport #2813: Fix Next watcher with custom distDir#2818

Open
github-actions[bot] wants to merge 2 commits into
stablefrom
backport/pr-2813-to-stable
Open

Backport #2813: Fix Next watcher with custom distDir#2818
github-actions[bot] wants to merge 2 commits into
stablefrom
backport/pr-2813-to-stable

Conversation

@github-actions

@github-actions github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

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

AI recommendation: This is a self-contained bug fix to the Next dev watcher's ignore logic in packages/next/src/builder-eager.ts, which exists on stable with the same hasIgnoredPathFragment/normalizedGeneratedDir structure being patched. The fix (ignoring a custom distDir) applies equally to stable and does not depend on any main-only APIs.

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>
@github-actions github-actions Bot requested review from a team and ijjk as code owners July 8, 2026 16:33
@changeset-bot

changeset-bot Bot commented Jul 8, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: b8fa3d9

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

This PR includes changesets to release 16 packages
Name Type
@workflow/next Patch
workflow Patch
@workflow/world-testing Patch
@workflow/core Patch
@workflow/builders Patch
@workflow/cli Patch
@workflow/nitro 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
@workflow/nuxt 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 8, 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 8, 2026 5:39pm
example-nextjs-workflow-webpack Ready Ready Preview, Comment Jul 8, 2026 5:39pm
example-workflow Ready Ready Preview, Comment Jul 8, 2026 5:39pm
workbench-astro-workflow Ready Ready Preview, Comment Jul 8, 2026 5:39pm
workbench-express-workflow Ready Ready Preview, Comment Jul 8, 2026 5:39pm
workbench-fastify-workflow Ready Ready Preview, Comment Jul 8, 2026 5:39pm
workbench-hono-workflow Ready Ready Preview, Comment Jul 8, 2026 5:39pm
workbench-nitro-workflow Ready Ready Preview, Comment Jul 8, 2026 5:39pm
workbench-nuxt-workflow Ready Ready Preview, Comment Jul 8, 2026 5:39pm
workbench-sveltekit-workflow Ready Ready Preview, Comment Jul 8, 2026 5:39pm
workbench-tanstack-start-workflow Ready Ready Preview, Comment Jul 8, 2026 5:39pm
workbench-vite-workflow Ready Ready Preview, Comment Jul 8, 2026 5:39pm
workflow-swc-playground Ready Ready Preview, Comment Jul 8, 2026 5:39pm
workflow-tarballs Ready Ready Preview, Comment Jul 8, 2026 5:39pm
workflow-web Ready Ready Preview, Comment Jul 8, 2026 5:39pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
workflow-docs Skipped Skipped Jul 8, 2026 5:39pm

Comment thread packages/next/src/builder-eager.ts Outdated
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

🧪 E2E Test Results

Some tests failed

Summary

Passed Failed Skipped Total
❌ ▲ Vercel Production 1065 12 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 79 102 9 190
✅ 📋 Other 594 0 36 630
Total 5365 114 381 5860

❌ Failed Tests

▲ Vercel Production (12 failed)

astro (1 failed):

example (1 failed):

express (1 failed):

fastify (1 failed):

hono (1 failed):

nextjs-turbopack (2 failed):

  • readableStreamWorkflow | wrun_01KX1XXNWS6WS08GKRK4DBVFJ5 | 🔍 observability
  • outputStreamWorkflow negative startIndex (reads from end)

nextjs-webpack (1 failed):

nitro (1 failed):

nuxt (1 failed):

sveltekit (1 failed):

vite (1 failed):

🌍 Community Worlds (102 failed)

redis (19 failed):

  • hookWorkflow | wrun_01KX1XYZPZT3GZXYSEYP7VKE9S
  • hookWorkflow is not resumable via public webhook endpoint | wrun_01KX1XZ6BPWVCWT93Z2ZRGW8BR
  • parallelStepsThenWebhookWorkflow - no hook_conflict from same-tick replay race | wrun_01KX1XZF2KZCNGDH3JPRE4EFP4
  • sleepingWorkflow | wrun_01KX1Y0F0N8KPXF2DWRZG75J9G
  • 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_01KX1Y8E38W2V1Q6NGFCQA99YY
  • hookGetConflictWorkflow - awaiting hook.getConflict() registers hook without payload | wrun_01KX1Y8SC6QV4TFHRX8YXEN6M2
  • hookGetConflictThenStepParallelWorkflow - hook.getConflict() continuation step runs alongside other steps | wrun_01KX1Y90H5PCGMDSC203A3V27Q
  • hookGetConflictWorkflow - hook.getConflict() resolves with the conflicting run when token is already registered | wrun_01KX1Y9E0V0E79X6588NHJMNYK
  • hookClaimOnlyMutexWorkflow - hook works as a pure run mutex without payload data | wrun_01KX1YA7E7S6PHBM6Y7XF8FFGX
  • hookAdoptOwnerResultWorkflow - duplicate adopts the owner result via conflict.returnValue | wrun_01KX1YABEBPXKM4QX7FWTVF747
  • hookSignalOwnerWorkflow - duplicate forwards its payload to the owner via resumeHook | wrun_01KX1YAG5DE7WN8FX0GMZQQJ8V
  • hookSupersedeOwnerWorkflow - duplicate cancels the owner and claims the released token | wrun_01KX1YAKMXGC7HG2YF1HB1NJ2A
  • resume-or-start route pattern - resumeHook retried after start() reaches the new run | wrun_01KX1YAVPV0WFYVE716XK3YT7N
  • pages router sleepingWorkflow via pages router
  • resilient start: addTenWorkflow completes when run_created returns 500 | wrun_01KX1YG8BHD6J91R3RGR00H0F2

turso (83 failed):

  • addTenWorkflow | wrun_01KX1XX67CEBRNWVGS9WK263SN
  • addTenWorkflow | wrun_01KX1XX67CEBRNWVGS9WK263SN
  • deploymentId: 'latest' is a no-op in non-Vercel worlds
  • wellKnownAgentWorkflow (.well-known/agent) | wrun_01KX1XXCETTM93DNZME0QG4VAW
  • should work with react rendering in step
  • promiseAllWorkflow | wrun_01KX1XXCCV82S9CYKX1NG7NT3R
  • promiseRaceWorkflow | wrun_01KX1XXHV7GCR7AWVHG33EHFB2
  • promiseAnyWorkflow | wrun_01KX1XXKTD7RMF07PEQTPMGV32
  • importedStepOnlyWorkflow | wrun_01KX1XXRZEB4EY81ATKEQ1SSFD
  • readableStreamWorkflow | wrun_01KX1XXNWS6WS08GKRK4DBVFJ5
  • hookWorkflow | wrun_01KX1XYZPZT3GZXYSEYP7VKE9S
  • hookWorkflow is not resumable via public webhook endpoint | wrun_01KX1XZ6BPWVCWT93Z2ZRGW8BR
  • webhookWorkflow | wrun_01KX1XZANBR1AY8CAF4WCCYHXN
  • parallelStepsThenWebhookWorkflow - no hook_conflict from same-tick replay race | wrun_01KX1XZF2KZCNGDH3JPRE4EFP4
  • sleepingWorkflow | wrun_01KX1Y0F0N8KPXF2DWRZG75J9G
  • parallelSleepWorkflow | wrun_01KX1Y0Y9KWXMQ4HDQKKHK75C2
  • sleepWinsRaceWorkflow | wrun_01KX1Y12HHJJS1EPMBDP6EEF8X
  • stepWinsRaceWorkflow | wrun_01KX1Y15TTAA5G89TAJ6D95318
  • nullByteWorkflow | wrun_01KX1Y1935B77T0YE7TQJK3PSV
  • workflowAndStepMetadataWorkflow | wrun_01KX1Y1B9AG988BBFQMNT22WV6
  • 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_01KX1Y3MKTYVBVY5H2TTY6XHB3
  • writableForwardedFromWorkflowWorkflow | wrun_01KX1Y44NST2KTX2H89SKWHP1V
  • writableForwardedFromStepWorkflow | wrun_01KX1Y4AZJNQF1X0PHM0PPGKX9
  • fetchWorkflow | wrun_01KX1Y4HFBK2G8SSTA69XY7ZX0
  • promiseRaceStressTestWorkflow | wrun_01KX1Y4MJASVM96TEA93ZD17X2
  • 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_01KX1Y81TJNJGVJCREMS20ES7T
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously | wrun_01KX1Y8E38W2V1Q6NGFCQA99YY
  • hookGetConflictWorkflow - awaiting hook.getConflict() registers hook without payload | wrun_01KX1Y8SC6QV4TFHRX8YXEN6M2
  • 'hookGetConflictWithPriorStepWorkflow' - hook.getConflict() does not block step execution | wrun_01KX1Y8VXNV93CQEGKFZY8X79R
  • 'hookGetConflictWithParallelStepWorkfl…' - hook.getConflict() does not block step execution | wrun_01KX1Y8YCZ0S5PEP4MTE2GS156
  • hookGetConflictThenStepParallelWorkflow - hook.getConflict() continuation step runs alongside other steps | wrun_01KX1Y90H5PCGMDSC203A3V27Q
  • hookGetConflictWorkflow - hook.getConflict() resolves with the conflicting run when token is already registered | wrun_01KX1Y9E0V0E79X6588NHJMNYK
  • hookClaimOnlyMutexWorkflow - hook works as a pure run mutex without payload data | wrun_01KX1YA7E7S6PHBM6Y7XF8FFGX
  • hookAdoptOwnerResultWorkflow - duplicate adopts the owner result via conflict.returnValue | wrun_01KX1YABEBPXKM4QX7FWTVF747
  • hookSignalOwnerWorkflow - duplicate forwards its payload to the owner via resumeHook | wrun_01KX1YAG5DE7WN8FX0GMZQQJ8V
  • hookSupersedeOwnerWorkflow - duplicate cancels the owner and claims the released token | wrun_01KX1YAKMXGC7HG2YF1HB1NJ2A
  • resume-or-start route pattern - resumeHook retried after start() reaches the new run | wrun_01KX1YAVPV0WFYVE716XK3YT7N
  • hookDisposeTestWorkflow - hook token reuse after explicit disposal while workflow still running | wrun_01KX1YB1XKVMY4H224JGCBQ552
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars) | wrun_01KX1YBFTQQ0F6AG6ASSTJMVBB
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument | wrun_01KX1YBR23WKQ7NRH9YS2ZS1PZ
  • closureVariableWorkflow - nested step functions with closure variables | wrun_01KX1YBX4W2T5QG9R94DFX1HXE
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step | wrun_01KX1YBZ7S11MVDTA7G98PK36V
  • 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_01KX1YCMFRBX4V08MGXVH5ZXRS
  • Calculator.calculate - static workflow method using static step methods from another class | wrun_01KX1YCSGCBFBD6H5GZABFFJES
  • AllInOneService.processNumber - static workflow method using sibling static step methods | wrun_01KX1YCZX32VVK04TJGBDDCQBG
  • ChainableService.processWithThis - static step methods using this to reference the class | wrun_01KX1YD6HMZGKBDB1DV95WVREC
  • thisSerializationWorkflow - step function invoked with .call() and .apply() | wrun_01KX1YDCK78F9SNX8482ED11B8
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE | wrun_01KX1YDKYFXBC3Z72PT88VEVAZ
  • instanceMethodStepWorkflow - instance methods with "use step" directive | wrun_01KX1YDT50TSACSHHKTJWY0CZ6
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context | wrun_01KX1YE5T4G5BDP5S3B7T87YFG
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument | wrun_01KX1YEDB3WZ0N5R2109F15NEZ
  • cancelRun - cancelling a running workflow | wrun_01KX1YEMZV6HFQK36CHDVPD2RD
  • cancelRun via CLI - cancelling a running workflow | wrun_01KX1YES4X77W5VJ2C7JSDK0RD
  • 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_01KX1YEZYDDV1MGTBD234RA11T
  • hookWithSleepFinalStepWorkflow - step only on final payload | wrun_01KX1YFADQW2HTM15HBA5Y39SN
  • sleepInLoopWorkflow - sleep inside loop with steps actually delays each iteration | wrun_01KX1YFJ0G85PRRZQ8MMSMPPTY
  • sleepWithSequentialStepsWorkflow - sequential steps work with concurrent sleep (control) | wrun_01KX1YFX227QW8CEBKK7832H01
  • importMetaUrlWorkflow - import.meta.url is available in step bundles | wrun_01KX1YG4BS2NVXSGY8XC6CBWFW
  • metadataFromHelperWorkflow - getWorkflowMetadata/getStepMetadata work from module-level helper (#1577) | wrun_01KX1YG6B38BBEZ5G2070E1B18
  • resilient start: addTenWorkflow completes when run_created returns 500 | wrun_01KX1YG8BHD6J91R3RGR00H0F2

Details by Category

❌ ▲ Vercel Production
App Passed Failed Skipped
❌ astro 96 1 8
❌ example 96 1 8
❌ express 96 1 8
❌ fastify 96 1 8
❌ hono 96 1 8
❌ nextjs-turbopack 100 2 3
❌ nextjs-webpack 101 1 3
❌ nitro 96 1 8
❌ nuxt 96 1 8
❌ sveltekit 96 1 8
❌ vite 96 1 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 3 0 3
✅ redis-dev 3 0 3
❌ redis 67 19 0
✅ turso-dev 3 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


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.

Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
Signed-off-by: Nathan Colosimo <110621881+NathanColosimo@users.noreply.github.com>

@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 the backport against the original #2813, with particular attention to the conflict adaptation. Approving.

The interesting part is the normalizedDistDir line, which correctly does NOT match the original. On main, normalizePath internally resolves relative paths against this.config.workingDir, so normalizePath(this.config.distDir) produces an absolute path there. Stable's normalizePath only normalizes slashes — a literal port (which is what the initial cherry-pick had) would have compared a relative distDir like .next against Watchpack's absolute pathnames and never matched, silently reintroducing the bug. The follow-up commit wrapping it in resolve(this.config.workingDir, ...) reproduces main's exact semantics on stable's simpler helper. I verified both branches' normalizePath implementations and the path spaces being compared (absolute in both consumers) to confirm the adaptation is semantically identical to the original.

Also verified: changeset carried over intact, resolve already imported on stable, and @workflow/next builds clean on the branch. The one CI failure (Community World Turso) is the known stable-lane flake, unrelated to a Next dev-watcher change.

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