Skip to content

[nest] Fix Vercel build output when using NextLocalBuilder#1472

Draft
VaguelySerious wants to merge 80 commits intomainfrom
peter/nest-fix-mar-20
Draft

[nest] Fix Vercel build output when using NextLocalBuilder#1472
VaguelySerious wants to merge 80 commits intomainfrom
peter/nest-fix-mar-20

Conversation

@VaguelySerious
Copy link
Member

@VaguelySerious VaguelySerious commented Mar 20, 2026

NestLocalBuilder.build() only generates runtime .mjs bundles for the WorkflowController — no Vercel Build Output API functions were created.

See community issue here: https://community.vercel.com/t/vercel-workflows-runs-stuck-in-pending-state-when-using-nestjs/36611/9, user repro in https://github.com/stasbel/nestjs-workflow-example/blob/main/package.json

@changeset-bot
Copy link

changeset-bot bot commented Mar 20, 2026

🦋 Changeset detected

Latest commit: bf49620

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

This PR includes changesets to release 16 packages
Name Type
@workflow/nest Patch
workflow Patch
@workflow/ai Patch
@workflow/world-testing Patch
@workflow/core Patch
@workflow/builders Patch
@workflow/cli Patch
@workflow/next Patch
@workflow/nitro Patch
@workflow/vitest Patch
@workflow/web-shared Patch
@workflow/astro 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
Copy link
Contributor

vercel bot commented Mar 20, 2026

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 Mar 21, 2026 2:43pm
example-nextjs-workflow-webpack Ready Ready Preview, Comment Mar 21, 2026 2:43pm
example-workflow Ready Ready Preview, Comment Mar 21, 2026 2:43pm
workbench-astro-workflow Ready Ready Preview, Comment Mar 21, 2026 2:43pm
workbench-express-workflow Ready Ready Preview, Comment Mar 21, 2026 2:43pm
workbench-fastify-workflow Ready Ready Preview, Comment Mar 21, 2026 2:43pm
workbench-hono-workflow Ready Ready Preview, Comment Mar 21, 2026 2:43pm
workbench-nestjs-workflow Ready Ready Preview, Comment Mar 21, 2026 2:43pm
workbench-nitro-workflow Ready Ready Preview, Comment Mar 21, 2026 2:43pm
workbench-nuxt-workflow Ready Ready Preview, Comment Mar 21, 2026 2:43pm
workbench-sveltekit-workflow Ready Ready Preview, Comment Mar 21, 2026 2:43pm
workbench-vite-workflow Ready Ready Preview, Comment Mar 21, 2026 2:43pm
workflow-nest Error Error Mar 21, 2026 2:43pm
workflow-swc-playground Ready Ready Preview, Comment Mar 21, 2026 2:43pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
workflow-docs Skipped Skipped Mar 21, 2026 2:43pm

@github-actions
Copy link
Contributor

github-actions bot commented Mar 20, 2026

🧪 E2E Test Results

Some tests failed

Summary

Passed Failed Skipped Total
✅ ▲ Vercel Production 780 0 67 847
✅ 💻 Local Development 727 0 120 847
✅ 📦 Local Production 782 0 142 924
✅ 🐘 Local Postgres 782 0 142 924
✅ 🪟 Windows 72 0 5 77
❌ 🌍 Community Worlds 118 56 21 195
✅ 📋 Other 198 0 33 231
Total 3459 56 530 4045

❌ Failed Tests

🌍 Community Worlds (56 failed)

mongodb (3 failed):

  • hookWorkflow is not resumable via public webhook endpoint | wrun_01KM8DMJTEGVQ0F6M97K1ZN1ME
  • webhookWorkflow | wrun_01KM8DMVQYX9VEGMZ45PS3PYVX
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously | wrun_01KM8DV70J08E4PVM47RTKF7MA

redis (2 failed):

  • hookWorkflow is not resumable via public webhook endpoint | wrun_01KM8DMJTEGVQ0F6M97K1ZN1ME
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously | wrun_01KM8DV70J08E4PVM47RTKF7MA

turso (51 failed):

  • addTenWorkflow | wrun_01KM8DKB4BW5XTV1FN1J20VT8N
  • addTenWorkflow | wrun_01KM8DKB4BW5XTV1FN1J20VT8N
  • wellKnownAgentWorkflow (.well-known/agent) | wrun_01KM8DMT3V9T5NR6TPBR8N23Y4
  • should work with react rendering in step
  • promiseAllWorkflow | wrun_01KM8DKHWMW4MX7BTJXS82EHQ2
  • promiseRaceWorkflow | wrun_01KM8DKQWRDR3D9ZC3DW6T0NQ0
  • promiseAnyWorkflow | wrun_01KM8DKT2HXMZCMK4561DFJRPG
  • importedStepOnlyWorkflow | wrun_01KM8DN8H2VW7KNWJKBJ1X78K5
  • hookWorkflow | wrun_01KM8DM7YPQSVERT49P692GHZ6
  • hookWorkflow is not resumable via public webhook endpoint | wrun_01KM8DMJTEGVQ0F6M97K1ZN1ME
  • webhookWorkflow | wrun_01KM8DMVQYX9VEGMZ45PS3PYVX
  • sleepingWorkflow | wrun_01KM8DN3707P2PQTSSY53FS0BS
  • parallelSleepWorkflow | wrun_01KM8DNFHYRSVPETKSMJF5HW49
  • nullByteWorkflow | wrun_01KM8DNJXK161X44TB5GPSNMSE
  • workflowAndStepMetadataWorkflow | wrun_01KM8DNPADC6J0HZKJCDWAT34V
  • fetchWorkflow | wrun_01KM8DQGJ2HWXKGS174XGYFBP7
  • promiseRaceStressTestWorkflow | wrun_01KM8DQM0ZJJW73STY67CME5SY
  • 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()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion | wrun_01KM8DTJ26964CFZARD3J2NR97
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously | wrun_01KM8DV70J08E4PVM47RTKF7MA
  • hookDisposeTestWorkflow - hook token reuse after explicit disposal while workflow still running | wrun_01KM8DVWBS2D2CSYED60YTXMY2
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars) | wrun_01KM8DWJ4BBZ4BT70C4K8DRW6W
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument | wrun_01KM8DWV4J9NEB9B5FP4TK71JV
  • closureVariableWorkflow - nested step functions with closure variables | wrun_01KM8DX21SDPX9NZY57H7SQHD8
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step | wrun_01KM8DX4A2B163GHKN5CRYXPEK
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly | wrun_01KM8DXMF66RTY2S0EJTNBE0MF
  • Calculator.calculate - static workflow method using static step methods from another class | wrun_01KM8DXT0YGE2YK3RTW52VFN6X
  • AllInOneService.processNumber - static workflow method using sibling static step methods | wrun_01KM8DY0QFW9P56A5BCS7Q929A
  • ChainableService.processWithThis - static step methods using this to reference the class | wrun_01KM8DY7E1X4SRAKY7F6AKWEDD
  • thisSerializationWorkflow - step function invoked with .call() and .apply() | wrun_01KM8DYDXCWZ0117KQFYYYW8Y7
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE | wrun_01KM8DYMPKR47Z14C8QJSTG12K
  • instanceMethodStepWorkflow - instance methods with "use step" directive | wrun_01KM8DYVQNXF3XRZNDX0M7Y239
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context | wrun_01KM8DZ6PZ6HFPJFNBXE6SETR6
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument | wrun_01KM8DZEP32GGVQVX751615XKD
  • cancelRun - cancelling a running workflow | wrun_01KM8DZQ44FGN6CX5ZZAMPK6TM
  • cancelRun via CLI - cancelling a running workflow | wrun_01KM8E00NR07KNCMBSESMEAK82
  • 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_01KM8E0CTWRKRFDR8SB2QZ1N72
  • sleepInLoopWorkflow - sleep inside loop with steps actually delays each iteration | wrun_01KM8E12FWM6TNKSE8MJX62QTT
  • sleepWithSequentialStepsWorkflow - sequential steps work with concurrent sleep (control) | wrun_01KM8E1FD180HR5EF6TERPGNKV

Details by Category

✅ ▲ Vercel Production
App Passed Failed Skipped
✅ astro 70 0 7
✅ example 70 0 7
✅ express 70 0 7
✅ fastify 70 0 7
✅ hono 70 0 7
✅ nextjs-turbopack 75 0 2
✅ nextjs-webpack 75 0 2
✅ nitro 70 0 7
✅ nuxt 70 0 7
✅ sveltekit 70 0 7
✅ vite 70 0 7
✅ 💻 Local Development
App Passed Failed Skipped
✅ astro-stable 66 0 11
✅ express-stable 66 0 11
✅ fastify-stable 66 0 11
✅ hono-stable 66 0 11
✅ nextjs-turbopack-stable 72 0 5
✅ nextjs-webpack-canary 55 0 22
✅ nextjs-webpack-stable 72 0 5
✅ nitro-stable 66 0 11
✅ nuxt-stable 66 0 11
✅ sveltekit-stable 66 0 11
✅ vite-stable 66 0 11
✅ 📦 Local Production
App Passed Failed Skipped
✅ astro-stable 66 0 11
✅ express-stable 66 0 11
✅ fastify-stable 66 0 11
✅ hono-stable 66 0 11
✅ nextjs-turbopack-canary 55 0 22
✅ nextjs-turbopack-stable 72 0 5
✅ nextjs-webpack-canary 55 0 22
✅ nextjs-webpack-stable 72 0 5
✅ nitro-stable 66 0 11
✅ nuxt-stable 66 0 11
✅ sveltekit-stable 66 0 11
✅ vite-stable 66 0 11
✅ 🐘 Local Postgres
App Passed Failed Skipped
✅ astro-stable 66 0 11
✅ express-stable 66 0 11
✅ fastify-stable 66 0 11
✅ hono-stable 66 0 11
✅ nextjs-turbopack-canary 55 0 22
✅ nextjs-turbopack-stable 72 0 5
✅ nextjs-webpack-canary 55 0 22
✅ nextjs-webpack-stable 72 0 5
✅ nitro-stable 66 0 11
✅ nuxt-stable 66 0 11
✅ sveltekit-stable 66 0 11
✅ vite-stable 66 0 11
✅ 🪟 Windows
App Passed Failed Skipped
✅ nextjs-turbopack 72 0 5
❌ 🌍 Community Worlds
App Passed Failed Skipped
✅ mongodb-dev 3 0 2
❌ mongodb 52 3 5
✅ redis-dev 3 0 2
❌ redis 53 2 5
✅ turso-dev 3 0 2
❌ turso 4 51 5
✅ 📋 Other
App Passed Failed Skipped
✅ e2e-local-dev-nest-stable 66 0 11
✅ e2e-local-postgres-nest-stable 66 0 11
✅ e2e-local-prod-nest-stable 66 0 11

📋 View full workflow run


Some E2E test jobs failed:

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

Check the workflow run for details.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 20, 2026

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Express 0.044s (-0.7%) 1.005s (~) 0.961s 10 1.00x
💻 Local Nitro 0.047s (~) 1.005s (~) 0.958s 10 1.07x
🐘 Postgres Express 0.062s (-12.2% 🟢) 1.012s (-0.5%) 0.949s 10 1.40x
🐘 Postgres Nitro 0.063s (-9.1% 🟢) 1.012s (~) 0.949s 10 1.42x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Next.js (Turbopack) 0.499s (-30.8% 🟢) 2.588s (~) 2.089s 10 1.00x
▲ Vercel Express 0.523s (-9.2% 🟢) 2.772s (+8.4% 🔺) 2.249s 10 1.05x
▲ Vercel Nitro ⚠️ missing - - - -

🔍 Observability: Next.js (Turbopack) | Express

workflow with 1 step

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Nitro 1.127s (~) 2.006s (~) 0.880s 10 1.00x
💻 Local Express 1.128s (~) 2.005s (~) 0.877s 10 1.00x
🐘 Postgres Express 1.149s (+0.8%) 2.012s (~) 0.864s 10 1.02x
🐘 Postgres Nitro 1.154s (+1.0%) 2.013s (~) 0.859s 10 1.02x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 2.104s (-4.7%) 3.694s (-5.1% 🟢) 1.590s 10 1.00x
▲ Vercel Next.js (Turbopack) 2.272s (-2.2%) 3.590s (-5.8% 🟢) 1.319s 10 1.08x
▲ Vercel Nitro ⚠️ missing - - - -

🔍 Observability: Express | Next.js (Turbopack)

workflow with 10 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Nitro 10.904s (~) 11.022s (~) 0.117s 3 1.00x
💻 Local Express 10.905s (~) 11.025s (~) 0.119s 3 1.00x
🐘 Postgres Express 10.917s (~) 11.044s (~) 0.127s 3 1.00x
🐘 Postgres Nitro 10.969s (~) 11.049s (~) 0.080s 3 1.01x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 16.464s (-5.2% 🟢) 18.249s (-5.8% 🟢) 1.785s 2 1.00x
▲ Vercel Next.js (Turbopack) 16.959s (-4.5%) 18.818s (-4.9%) 1.859s 2 1.03x
▲ Vercel Nitro ⚠️ missing - - - -

🔍 Observability: Express | Next.js (Turbopack)

workflow with 25 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 14.710s (+0.9%) 15.044s (~) 0.335s 4 1.00x
🐘 Postgres Nitro 14.729s (-0.6%) 15.044s (~) 0.316s 4 1.00x
💻 Local Nitro 14.889s (~) 15.028s (~) 0.139s 4 1.01x
💻 Local Express 14.917s (-0.5%) 15.028s (-3.2%) 0.111s 4 1.01x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Next.js (Turbopack) 32.017s (-1.4%) 33.498s (-3.4%) 1.481s 2 1.00x
▲ Vercel Express 32.675s (-3.3%) 35.075s (-1.5%) 2.400s 2 1.02x
▲ Vercel Nitro ⚠️ missing - - - -

🔍 Observability: Next.js (Turbopack) | Express

workflow with 50 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 14.309s (+2.1%) 15.042s (+4.0%) 0.733s 6 1.00x
🐘 Postgres Nitro 14.436s (~) 15.042s (~) 0.606s 6 1.01x
💻 Local Nitro 16.358s (-0.6%) 17.030s (~) 0.672s 6 1.14x
💻 Local Express 16.602s (~) 17.029s (~) 0.427s 6 1.16x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 58.142s (+0.8%) 59.410s (~) 1.268s 2 1.00x
▲ Vercel Next.js (Turbopack) 60.272s (-4.0%) 61.767s (-4.2%) 1.495s 2 1.04x
▲ Vercel Nitro ⚠️ missing - - - -

🔍 Observability: Express | Next.js (Turbopack)

Promise.all with 10 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 1.288s (+1.8%) 2.012s (~) 0.725s 15 1.00x
🐘 Postgres Nitro 1.300s (+0.6%) 2.011s (~) 0.711s 15 1.01x
💻 Local Nitro 1.488s (~) 2.005s (~) 0.517s 15 1.16x
💻 Local Express 1.510s (~) 2.006s (~) 0.495s 15 1.17x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 2.388s (-13.4% 🟢) 4.196s (-9.1% 🟢) 1.808s 8 1.00x
▲ Vercel Next.js (Turbopack) 2.825s (+13.4% 🔺) 4.026s (+3.2%) 1.200s 8 1.18x
▲ Vercel Nitro ⚠️ missing - - - -

🔍 Observability: Express | Next.js (Turbopack)

Promise.all with 25 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 2.472s (~) 3.013s (~) 0.540s 10 1.00x
🐘 Postgres Express 2.489s (+1.1%) 3.014s (~) 0.524s 10 1.01x
💻 Local Express 2.912s (-2.9%) 3.108s (-12.8% 🟢) 0.196s 10 1.18x
💻 Local Nitro 2.920s (+1.7%) 3.208s (+3.2%) 0.287s 10 1.18x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Next.js (Turbopack) 3.957s (+50.4% 🔺) 5.612s (+39.4% 🔺) 1.655s 7 1.00x
▲ Vercel Express 4.398s (+54.0% 🔺) 6.178s (+38.4% 🔺) 1.780s 6 1.11x
▲ Vercel Nitro ⚠️ missing - - - -

🔍 Observability: Next.js (Turbopack) | Express

Promise.all with 50 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 3.617s (~) 4.015s (~) 0.398s 8 1.00x
🐘 Postgres Express 3.686s (+2.7%) 4.015s (~) 0.329s 8 1.02x
💻 Local Nitro 7.792s (-4.1%) 8.020s (-8.6% 🟢) 0.228s 4 2.15x
💻 Local Express 8.130s (-4.1%) 8.770s (-2.8%) 0.639s 4 2.25x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 3.656s (+11.3% 🔺) 5.143s (+10.2% 🔺) 1.487s 6 1.00x
▲ Vercel Next.js (Turbopack) 3.860s (+15.1% 🔺) 5.486s (+9.5% 🔺) 1.626s 6 1.06x
▲ Vercel Nitro ⚠️ missing - - - -

🔍 Observability: Express | Next.js (Turbopack)

Promise.race with 10 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 1.284s (+1.9%) 2.011s (~) 0.727s 15 1.00x
🐘 Postgres Nitro 1.288s (+0.9%) 2.011s (~) 0.723s 15 1.00x
💻 Local Nitro 1.542s (-1.2%) 2.005s (~) 0.463s 15 1.20x
💻 Local Express 1.545s (+0.5%) 2.005s (~) 0.460s 15 1.20x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Next.js (Turbopack) 2.121s (-18.5% 🟢) 3.815s (-4.9%) 1.695s 8 1.00x
▲ Vercel Express 2.688s (+21.6% 🔺) 4.574s (+18.2% 🔺) 1.885s 7 1.27x
▲ Vercel Nitro ⚠️ missing - - - -

🔍 Observability: Next.js (Turbopack) | Express

Promise.race with 25 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 2.464s (+0.5%) 3.013s (~) 0.549s 10 1.00x
🐘 Postgres Nitro 2.472s (+0.6%) 3.012s (~) 0.540s 10 1.00x
💻 Local Express 3.155s (+4.0%) 4.010s (+6.7% 🔺) 0.855s 8 1.28x
💻 Local Nitro 3.166s (+4.5%) 4.009s (+9.1% 🔺) 0.844s 8 1.28x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 2.416s (-9.8% 🟢) 3.710s (-19.5% 🟢) 1.293s 9 1.00x
▲ Vercel Next.js (Turbopack) 2.833s (+19.1% 🔺) 4.146s (+13.2% 🔺) 1.313s 8 1.17x
▲ Vercel Nitro ⚠️ missing - - - -

🔍 Observability: Express | Next.js (Turbopack)

Promise.race with 50 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 3.614s (~) 4.014s (~) 0.400s 8 1.00x
🐘 Postgres Nitro 3.623s (~) 4.014s (~) 0.392s 8 1.00x
💻 Local Nitro 8.405s (-2.8%) 9.021s (~) 0.616s 4 2.33x
💻 Local Express 8.676s (-4.2%) 9.021s (-7.7% 🟢) 0.345s 4 2.40x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Next.js (Turbopack) 3.350s (-14.5% 🟢) 5.007s (-8.8% 🟢) 1.656s 6 1.00x
▲ Vercel Express 3.749s (+22.2% 🔺) 5.109s (+12.5% 🔺) 1.360s 6 1.12x
▲ Vercel Nitro ⚠️ missing - - - -

🔍 Observability: Next.js (Turbopack) | Express

workflow with 10 sequential data payload steps (10KB)

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 0.874s (+0.9%) 1.009s (-1.7%) 0.135s 60 1.00x
🐘 Postgres Nitro 0.890s (-0.7%) 1.044s (~) 0.153s 58 1.02x
💻 Local Nitro 0.962s (+0.7%) 1.076s (+5.3% 🔺) 0.114s 56 1.10x
💻 Local Express 0.974s (-0.9%) 1.076s (-1.8%) 0.102s 56 1.11x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Next.js (Turbopack) 9.522s (-9.3% 🟢) 10.821s (-12.2% 🟢) 1.300s 6 1.00x
▲ Vercel Express 10.069s (+1.3%) 11.859s (+1.4%) 1.790s 6 1.06x
▲ Vercel Nitro ⚠️ missing - - - -

🔍 Observability: Next.js (Turbopack) | Express

workflow with 25 sequential data payload steps (10KB)

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 2.112s (~) 2.979s (-1.1%) 0.867s 31 1.00x
🐘 Postgres Nitro 2.176s (+0.7%) 3.012s (+1.1%) 0.836s 30 1.03x
💻 Local Nitro 2.929s (-0.9%) 3.041s (-2.2%) 0.111s 30 1.39x
💻 Local Express 3.006s (~) 3.416s (-3.7%) 0.410s 27 1.42x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 28.880s (-13.1% 🟢) 30.380s (-13.6% 🟢) 1.500s 3 1.00x
▲ Vercel Next.js (Turbopack) 29.421s (-9.9% 🟢) 30.903s (-9.5% 🟢) 1.482s 3 1.02x
▲ Vercel Nitro ⚠️ missing - - - -

🔍 Observability: Express | Next.js (Turbopack)

workflow with 50 sequential data payload steps (10KB)

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 4.361s (+2.3%) 5.015s (+0.8%) 0.654s 24 1.00x
🐘 Postgres Nitro 4.390s (+1.3%) 5.014s (~) 0.624s 24 1.01x
💻 Local Nitro 8.947s (-0.9%) 9.324s (-1.6%) 0.377s 13 2.05x
💻 Local Express 9.152s (~) 9.710s (-0.8%) 0.557s 13 2.10x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 84.129s (-4.5%) 86.315s (-3.9%) 2.186s 2 1.00x
▲ Vercel Next.js (Turbopack) 85.165s (-12.6% 🟢) 87.241s (-12.2% 🟢) 2.076s 2 1.01x
▲ Vercel Nitro ⚠️ missing - - - -

🔍 Observability: Express | Next.js (Turbopack)

workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 0.297s (-1.7%) 1.009s (~) 0.712s 60 1.00x
🐘 Postgres Nitro 0.312s (+5.9% 🔺) 1.009s (~) 0.697s 60 1.05x
💻 Local Express 0.589s (-2.4%) 1.005s (~) 0.416s 60 1.98x
💻 Local Nitro 0.628s (+5.1% 🔺) 1.021s (+1.7%) 0.393s 59 2.12x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 2.039s (-18.8% 🟢) 3.595s (-10.7% 🟢) 1.556s 18 1.00x
▲ Vercel Next.js (Turbopack) 2.202s (+15.9% 🔺) 3.880s (+8.5% 🔺) 1.678s 16 1.08x
▲ Vercel Nitro ⚠️ missing - - - -

🔍 Observability: Express | Next.js (Turbopack)

workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 0.533s (+1.0%) 1.009s (~) 0.476s 90 1.00x
🐘 Postgres Nitro 0.554s (+2.7%) 1.010s (~) 0.456s 90 1.04x
💻 Local Nitro 2.450s (-1.0%) 3.008s (~) 0.558s 30 4.60x
💻 Local Express 2.525s (-2.2%) 3.009s (~) 0.484s 30 4.74x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 3.248s (+5.5% 🔺) 4.761s (+5.8% 🔺) 1.512s 19 1.00x
▲ Vercel Next.js (Turbopack) 3.494s (+1.6%) 4.907s (+2.1%) 1.413s 19 1.08x
▲ Vercel Nitro ⚠️ missing - - - -

🔍 Observability: Express | Next.js (Turbopack)

workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 0.925s (+3.0%) 1.158s (+11.3% 🔺) 0.234s 104 1.00x
🐘 Postgres Nitro 0.953s (+1.5%) 1.322s (+10.9% 🔺) 0.370s 91 1.03x
💻 Local Nitro 10.854s (-2.3%) 11.299s (-3.1%) 0.445s 11 11.74x
💻 Local Express 11.282s (~) 11.938s (-0.7%) 0.656s 11 12.20x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 7.747s (+6.5% 🔺) 9.522s (+6.4% 🔺) 1.774s 13 1.00x
▲ Vercel Next.js (Turbopack) 35.576s (+353.8% 🔺) 37.557s (+300.8% 🔺) 1.981s 11 4.59x
▲ Vercel Nitro ⚠️ missing - - - -

🔍 Observability: Express | Next.js (Turbopack)

Stream Benchmarks (includes TTFB metrics)
workflow with stream

💻 Local Development

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Nitro 0.198s (+1.0%) 1.003s (~) 0.011s (-5.9% 🟢) 1.017s (~) 0.819s 10 1.00x
💻 Local Express 0.201s (-1.5%) 1.003s (~) 0.011s (-6.7% 🟢) 1.017s (~) 0.816s 10 1.02x
🐘 Postgres Express 0.213s (-1.4%) 1.000s (+0.5%) 0.002s (+33.3% 🔺) 1.013s (~) 0.799s 10 1.08x
🐘 Postgres Nitro 0.226s (-5.6% 🟢) 0.996s (~) 0.002s (+42.9% 🔺) 1.013s (~) 0.787s 10 1.14x
💻 Local Next.js (Turbopack) ⚠️ missing - - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - - -

▲ Production (Vercel)

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 1.725s (+2.2%) 2.832s (+7.2% 🔺) 0.504s (+9065.5% 🔺) 3.941s (+21.8% 🔺) 2.216s 10 1.00x
▲ Vercel Next.js (Turbopack) 2.004s (+15.9% 🔺) 2.897s (-3.0%) 0.644s (+10462.3% 🔺) 4.200s (+16.8% 🔺) 2.196s 10 1.16x
▲ Vercel Nitro ⚠️ missing - - - - -

🔍 Observability: Express | Next.js (Turbopack)

stream pipeline with 5 transform steps (1MB)

💻 Local Development

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 0.675s (-2.7%) 1.005s (~) 0.015s (+296.0% 🔺) 1.038s (+1.1%) 0.364s 59 1.00x
🐘 Postgres Nitro 0.704s (-2.6%) 1.004s (~) 0.005s (+42.3% 🔺) 1.029s (~) 0.325s 59 1.04x
💻 Local Nitro 0.719s (-1.1%) 1.009s (~) 0.010s (+5.6% 🔺) 1.023s (~) 0.304s 59 1.07x
💻 Local Express 0.732s (-5.6% 🟢) 1.010s (-1.7%) 0.010s (+0.7%) 1.024s (-1.6%) 0.292s 59 1.09x
💻 Local Next.js (Turbopack) ⚠️ missing - - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - - -

▲ Production (Vercel)

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Next.js (Turbopack) 4.501s (-1.1%) 5.518s (-4.7%) 0.342s (+70.9% 🔺) 6.465s (-1.0%) 1.965s 10 1.00x
▲ Vercel Express 5.014s (+14.9% 🔺) 5.938s (+6.5% 🔺) 0.236s (-11.4% 🟢) 6.869s (+7.0% 🔺) 1.855s 9 1.11x
▲ Vercel Nitro ⚠️ missing - - - - -

🔍 Observability: Next.js (Turbopack) | Express

10 parallel streams (1MB each)

💻 Local Development

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 1.128s (+26.3% 🔺) 1.900s (+75.4% 🔺) 0.000s (-100.0% 🟢) 1.918s (+73.6% 🔺) 0.789s 32 1.00x
🐘 Postgres Nitro 1.152s (+25.0% 🔺) 1.961s (+84.5% 🔺) 0.000s (+80.6% 🔺) 1.980s (+83.2% 🔺) 0.829s 31 1.02x
💻 Local Nitro 1.213s (-1.0%) 2.019s (~) 0.000s (-7.7% 🟢) 2.022s (~) 0.809s 30 1.08x
💻 Local Express 1.240s (-1.5%) 2.020s (~) 0.000s (-29.4% 🟢) 2.023s (~) 0.783s 30 1.10x
💻 Local Next.js (Turbopack) ⚠️ missing - - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - - -

▲ Production (Vercel)

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 2.900s (+21.3% 🔺) 4.318s (+31.3% 🔺) 0.000s (+Infinity% 🔺) 4.925s (+24.9% 🔺) 2.025s 13 1.00x
▲ Vercel Next.js (Turbopack) 3.545s (+21.0% 🔺) 4.782s (+19.9% 🔺) 0.000s (-12.5% 🟢) 5.292s (+15.3% 🔺) 1.747s 12 1.22x
▲ Vercel Nitro ⚠️ missing - - - - -

🔍 Observability: Express | Next.js (Turbopack)

fan-out fan-in 10 streams (1MB each)

💻 Local Development

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 2.007s (+11.2% 🔺) 2.395s (+14.1% 🔺) 0.000s (NaN%) 2.414s (+13.8% 🔺) 0.407s 25 1.00x
🐘 Postgres Nitro 2.160s (+14.2% 🔺) 2.767s (+24.7% 🔺) 0.000s (+22.7% 🔺) 2.787s (+24.4% 🔺) 0.627s 22 1.08x
💻 Local Nitro 3.465s (+4.1%) 4.101s (+3.3%) 0.001s (+156.0% 🔺) 4.105s (+3.3%) 0.640s 15 1.73x
💻 Local Express 3.520s (+2.2%) 4.031s (-1.6%) 0.001s (+12.5% 🔺) 4.035s (-1.6%) 0.515s 15 1.75x
💻 Local Next.js (Turbopack) ⚠️ missing - - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - - -

▲ Production (Vercel)

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 4.511s (+37.3% 🔺) 5.510s (+20.6% 🔺) 0.000s (-100.0% 🟢) 6.109s (+18.8% 🔺) 1.598s 11 1.00x
▲ Vercel Next.js (Turbopack) 5.264s (+20.5% 🔺) 6.369s (+18.0% 🔺) 0.000s (-100.0% 🟢) 6.914s (+16.0% 🔺) 1.650s 9 1.17x
▲ Vercel Nitro ⚠️ missing - - - - -

🔍 Observability: Express | Next.js (Turbopack)

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World 🥇 Fastest Framework Wins
💻 Local Nitro 17/21
🐘 Postgres Express 19/21
▲ Vercel Express 14/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework 🥇 Fastest World Wins
Express 🐘 Postgres 15/21
Next.js (Turbopack) ▲ Vercel 21/21
Nitro 🐘 Postgres 17/21
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Slurp: Time from first byte to complete stream consumption (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • Samples: Number of benchmark iterations run
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

  • Local: success
  • Postgres: success
  • Vercel: failure

Check the workflow run for details.

Copy link
Contributor

@vercel vercel bot left a comment

Choose a reason for hiding this comment

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

Additional Suggestion:

Missing esbuild dependency in @workflow/nest package.json causes runtime MODULE_NOT_FOUND error when calling buildVercelOutput().

Fix on Vercel

NestLocalBuilder.build() only generates runtime .mjs bundles for the
WorkflowController — no Vercel Build Output API functions are created.
VQS discovers consumers via experimentalTriggers in .vc-config.json,
so NestJS deployments silently fail with "no v2beta consumer".

Add buildVercelOutput() which generates:
- .well-known/workflow/v1/step.func with STEP_QUEUE_TRIGGER
- .well-known/workflow/v1/flow.func with WORKFLOW_QUEUE_TRIGGER
- .well-known/workflow/v1/webhook/[token].func
- api/index.js.func (esbuild-bundled NestJS app)
- config.json with routing rules

Also update NestJS getting-started docs and README with Vercel
deployment instructions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@VaguelySerious VaguelySerious force-pushed the peter/nest-fix-mar-20 branch from 880e1af to 565712c Compare March 20, 2026 23:16
VaguelySerious and others added 2 commits March 20, 2026 16:30
Add nest to the e2e-vercel-prod matrix in tests.yml with the correct
project ID (prj_G3RlX1TsB5V2hcqTNvuVoJXdfE1o) and slug
(workbench-nestjs-workflow).

Set up the workbench for Vercel Build Output API deployment:
- Add api/index.js entry point for the NestJS serverless function
- Add scripts/build-vercel.ts postbuild step calling buildVercelOutput()
- Update vercel.json with buildCommand
- Fix project slug in create-test-matrix.mjs
- Clear framework preset from "NestJS" to "Other" on Vercel project

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add a `build` subcommand to the workflow-nest CLI that builds workflow
bundles and, when VERCEL env is detected, automatically generates the
Build Output API with experimentalTriggers. The entry point is auto-
detected from api/index.js (or can be specified via --entry).

This replaces the need for a custom scripts/build-vercel.ts file —
users just add `"postbuild": "workflow-nest build"` to package.json.

Also document the Vercel project requirement: framework preset must be
set to "Other" (not "NestJS") to avoid conflicting with Build Output API.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
VaguelySerious and others added 30 commits March 21, 2026 03:09
Vercel Build Output API requires check:true on routes after
handle:miss. With framework=null (no NestJS preset), this validation
is enforced.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
With framework=null (no NestJS preset), Build Output API functions
must be self-contained since no NFT tracing is done. Bundle the
NestJS entry point with esbuild into a single CJS file. Use esbuild
define to inject the manifest JSON as a constant.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
With framework=nestjs, @vercel/node handles NFT and function bundling.
The entry point imports __manifest.js which the builder populates
during postbuild. NFT traces the static import and includes the file.

Remove esbuild bundling and catch-all routing — the NestJS framework
preset handles both. Only keep the webhook dynamic route and workflow
function generation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Use readFileSync with a path computed from process.cwd() — NFT should
trace the join() pattern and include the manifest file. Remove the
__manifest.js import approach that was fragile.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
With framework=nestjs, @vercel/node creates the handler from
dist/main.js — our _vercel/entry.js is not used. The
WorkflowController.handleManifest() uses readFileSync with a computed
path that NFT can't trace.

Add a static readFileSync('.nestjs/workflow/manifest.json') call in
app.module.ts that NFT CAN analyze statically. This ensures the
manifest file (created by workflow-nest build during postbuild) is
included in the Lambda bundle.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The WorkflowController's readFileSync with a dynamic path can't be
traced by NFT. Instead, eagerly read the manifest in app.module.ts at
module load time and store it on globalThis. The controller checks
globalThis.__workflowManifestJson before falling back to readFileSync.

The static string '.nestjs/workflow/manifest.json' in app.module.ts
gives NFT the best chance to trace the file.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
NFT resolves readFileSync paths relative to the containing file.
Since app.module.ts compiles to dist/app.module.js, the path to
.nestjs/workflow/manifest.json needs to be ../.nestjs/workflow/...

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…tdirs

NFT might skip .nestjs/ directory (dotdir). Rename output dir to
workflow-out/ and update the readFileSync path to ../workflow-out/.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
NFT always includes files in dist/ for NestJS projects. Copy manifest
to dist/workflow-manifest.json during postbuild. The app.module reads
it with readFileSync('./workflow-manifest.json') which resolves
relative to dist/app.module.js.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
readFileSync with a relative path resolves from CWD at runtime, not
from the file's directory. Use import.meta.url + dirname to resolve
from the actual module location (dist/).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
new URL('./file', import.meta.url) is the ESM standard pattern that
@vercel/nft traces statically AND resolves correctly at runtime
(relative to the module, not CWD).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
NFT doesn't trace readFileSync with new URL() or computed paths.
Use createRequire(import.meta.url) to require() the manifest JSON.
require() resolves relative to the file AND NFT traces it statically.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ist/

Generate the manifest in the build step before nest build compiles.
Then copy manifest.json to dist/workflow-manifest.json so it's
alongside the compiled app.module.js. The require() call in the
compiled module resolves it correctly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Explicitly include dist/workflow-manifest.json in all serverless
functions via vercel.json's functions.includeFiles. NFT can't trace
the createRequire pattern, so the file must be explicitly included.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The functions config only matches api/ directory files. Move entry
back to api/index.js and use includeFiles to force-include the
manifest file in the Lambda.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The workflow-nest build CLI copies manifest.json to dist/ during
postbuild. The app.module.ts reads it at module load time using
join(process.cwd(), 'dist', 'workflow-manifest.json'). On Vercel's
Lambda, CWD is the project root and dist/ is always NFT-included.

The globalThis.__workflowManifestJson value is read by the
WorkflowController as a fallback when readFileSync fails.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
NFT can't trace readFileSync with computed paths. But it DOES trace
dynamic import() with string literals. Generate a JS module
(dist/workflow-manifest.js) and use await import('./workflow-manifest.js')
in app.module.ts. NFT sees the static string and includes the file.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The env var may not be reaching the Lambda runtime. Force-set it
in app.module.ts at import time when VERCEL env is detected.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Top-level await may crash in the Vercel Lambda context. Use
createRequire(import.meta.url) for synchronous require() of
the manifest module.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
SWC compiles app.module.ts to CJS. The createRequire require() can't
load ESM modules. Write the manifest module as CJS (module.exports)
instead of ESM (export default).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
With package.json type=module, .js files are ESM. CJS module.exports
in a .js file is misinterpreted. Use .cjs extension to force CJS.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ively

.cjs files may not be included by the NestJS Vercel preset. Use .json
which require() auto-parses and is universally included in dist/.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
In ESM modules, bare require() isn't available. createRequire creates
a require function that resolves relative to the file. The .json file
in dist/ IS copied to the Lambda by the NestJS Vercel preset (it
copies all of dist/). This approach works both locally and on Vercel.

Verified locally: globalThis.__workflowManifestJson is set correctly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The fix:
1. prebuild: workflow-nest build generates .nestjs/workflow/manifest.json
2. nest-cli.json assets: copies manifest to dist/workflow/manifest.json
3. nest build: produces dist/ with the manifest included
4. app.module.ts: createRequire loads dist/workflow/manifest.json
5. NestJS Vercel preset includes ALL nest build output in Lambda

Key insight: nest build's assets copy runs during compilation, so the
manifest is part of the official dist/ output that the NestJS Vercel
preset deploys. No NFT tracing needed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add configureManifest(json) to WorkflowController which sets the
manifest as a string constant. The controller checks this before
falling back to readFileSync. WorkflowModule.forRoot() accepts a
manifestJson option that calls configureManifest during setup.

In the workbench:
- prebuild generates manifest via workflow-nest build
- nest-cli.json assets copies it to dist/workflow/manifest.json
- app.module.ts loads it via createRequire and passes to forRoot()
- On Vercel, the controller serves the pre-loaded manifest directly

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The definitive fix for the manifest on Vercel:

1. prebuild: workflow-nest build generates src/_manifest-data.ts
   containing the manifest as an exported string constant
2. nest build: SWC compiles it to dist/_manifest-data.js
3. app.module.ts: imports _manifest-data.js via standard ESM import
4. NFT traces the standard import and includes the compiled module
5. WorkflowModule.forRoot({ manifestJson }) passes it to the controller

This avoids ALL the previous issues:
- No readFileSync with untraceable paths
- No createRequire that NFT can't follow
- No .cjs/.json files that Vercel doesn't include
- The manifest is part of the standard compiled output

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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