mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[GH-ISSUE #739] dev server: POST/PATCH API routes return 500 (fetch failed in miniflare dispatchFetch) #160
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#160
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?
Originally created by @unitedcolorsofg on GitHub (Apr 1, 2026).
Original GitHub issue: https://github.com/cloudflare/vinext/issues/739
Summary
All POST and PATCH API routes return HTTP 500 in the vinext dev server. GET requests to the same routes work correctly. The error originates from miniflare's
dispatchFetchinside@cloudflare/vite-plugin.Production builds are unaffected -- this is dev server only.
Cross-posted to cloudflare/workers-sdk for the miniflare/vite-plugin side.
Environment
Reproduction
Any API route that calls an auth session check (better-auth
api.getSession()) on a POST or PATCH request crashes. The same route responds correctly to GET (405, no handler) and works fine in production builds.Minimal example (
app/api/notifications/mark-all-read/route.ts):Error
Investigation
auth+db+ service modules works for POST, suggesting possible module graph or HMR state issue with established routesrequestparameters from handlers: no effect127.0.0.1to better-authtrustedOrigins: no effect@cloudflare/vite-plugin's request dispatch to miniflare/workerd, not in application codeImpact
All Playwright E2E tests targeting POST/PATCH endpoints fail (12 failures out of an otherwise passing suite).
@unitedcolorsofg commented on GitHub (Apr 1, 2026):
Cross-posted to cloudflare/workers-sdk: https://github.com/cloudflare/workers-sdk/issues/13189
@unitedcolorsofg commented on GitHub (Apr 1, 2026):
Duplicate