fix(next,builders): resolve next build failures from stale socket and dynamic imports#1702
fix(next,builders): resolve next build failures from stale socket and dynamic imports#1702TooTallNate wants to merge 1 commit intomainfrom
next build failures from stale socket and dynamic imports#1702Conversation
… dynamic imports - Guard socket-info filesystem fallback behind WORKFLOW_NEXT_LAZY_DISCOVERY to prevent ECONNREFUSED when a stale workflow-socket.json exists from a previous dev session - Post-process step bundles to add webpackIgnore comments to dynamic import() calls with non-literal arguments, preventing Turbopack 'Module not found' errors for runtime-resolved paths
🦋 Changeset detectedLatest commit: 92658e3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 16 packages
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 |
🧪 E2E Test Results❌ Some tests failed Summary
❌ Failed Tests🌍 Community Worlds (74 failed)mongodb (7 failed):
redis (7 failed):
turso (60 failed):
Details by Category✅ ▲ Vercel Production
✅ 💻 Local Development
✅ 📦 Local Production
✅ 🐘 Local Postgres
✅ 🪟 Windows
❌ 🌍 Community Worlds
✅ 📋 Other
❌ Some E2E test jobs failed:
Check the workflow run for details. |
📊 Benchmark Results
workflow with no steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) workflow with 1 step💻 Local Development
▲ Production (Vercel)
🔍 Observability: Next.js (Turbopack) | Express workflow with 10 sequential steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) workflow with 25 sequential steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Next.js (Turbopack) | Express workflow with 50 sequential steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) Promise.all with 10 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Next.js (Turbopack) | Express Promise.all with 25 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) Promise.all with 50 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) Promise.race with 10 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Next.js (Turbopack) | Express Promise.race with 25 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) Promise.race with 50 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) workflow with 10 sequential data payload steps (10KB)💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) workflow with 25 sequential data payload steps (10KB)💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) workflow with 50 sequential data payload steps (10KB)💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) workflow with 10 concurrent data payload steps (10KB)💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) workflow with 25 concurrent data payload steps (10KB)💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) workflow with 50 concurrent data payload steps (10KB)💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) Stream Benchmarks (includes TTFB metrics)workflow with stream💻 Local Development
▲ Production (Vercel)
🔍 Observability: Next.js (Turbopack) | Express stream pipeline with 5 transform steps (1MB)💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) 10 parallel streams (1MB each)💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) fan-out fan-in 10 streams (1MB each)💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) SummaryFastest Framework by WorldWinner determined by most benchmark wins
Fastest World by FrameworkWinner determined by most benchmark wins
Column Definitions
Worlds:
❌ Some benchmark jobs failed:
Check the workflow run for details. |
VaguelySerious
left a comment
There was a problem hiding this comment.
LGTM from testing, also see #1713 which runs this code in e2e tests
Summary
Fixes
next buildfailures introduced in5.0.0-beta.1caused by two separate regressions:ECONNREFUSED during build (
@workflow/next): The loader'sgetSocketInfoFilePath()filesystem fallback (added in fix(next): skip eager discovery in deferred build mode #1646) unconditionally reads.next/cache/workflow-socket.json, which may contain stale credentials from a previousnext devsession. When the eager builder is active (no socket server), this causesconnect ECONNREFUSED. Fixed by gating the fallback behindWORKFLOW_NEXT_LAZY_DISCOVERY=1.Module not found: Can't resolve './ROOT'(@workflow/builders):@vercel/queue'simport(absolutePath)pattern gets inlined into the generated step route bundle by esbuild. Turbopack traces the dynamic import at build time and fails becausepath.resolve(process.cwd(), ...)produces an unresolvable path. Fixed by post-processing the step bundle to add/* webpackIgnore: true */comments to dynamicimport()calls with non-literal arguments.Test plan
next buildsucceeds on a reproduction project that previously failed with 5 build errors (3 ECONNREFUSED + 2 module-not-found), now produces 0 errorsnode-module-esbuild-plugin.test.ts)