mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #460] [MERGED] fix: vinext start for Cloudflare App Router worker exports #587
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#587
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/cloudflare/vinext/pull/460
Author: @JaredStowell
Created: 3/11/2026
Status: ✅ Merged
Merged: 3/11/2026
Merged by: @james-elicx
Base:
main← Head:jstowell/fix-vinext-start-worker-entry📝 Commits (1)
189610fAdd Node execution context handling📊 Changes
2 files changed (+113 additions, -8 deletions)
View changed files
📝
packages/vinext/src/server/prod-server.ts(+40 -8)📝
tests/app-router.test.ts(+73 -0)📄 Description
Fix
vinext startfor App Router production builds emitted through@cloudflare/vite-plugin.Reported here: https://github.com/cloudflare/vinext/issues/459
Cloudflare App Router builds can default-export a Worker-style object with
fetch()instead of a plain request handler function.vinext startassumed the default export was always callable, which caused startup to fail with:This change teaches the production server to accept both supported App Router entry shapes:
default (request) => Responsedefault { fetch(request, env, ctx) }It also keeps an explicit error for unsupported export shapes.
Changes
vinext startctx.waitUntil()does not crashVerification
Ran:
pnpm test tests/app-router.test.tspnpm run fmtpnpm run typecheckAlso verified manually with a real Cloudflare App Router build:
examples/benchmarksnode ../../packages/vinext/dist/cli.js start --port 4311GET /returned200 OK🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.