Backport request: Server action that fails in middleware fails silently #73043
Labels
bug
Issue was opened via the bug report template.
Middleware
Related to Next.js Middleware.
Runtime
Related to Node.js or Edge Runtime with Next.js.
Link to the code that reproduces this issue
https://github.com/nphmuller/next-server-action-middleware-error
To Reproduce
npm run dev
Code from repro:
middleware.ts:
page.tsx:
actions.ts:
Current vs. Expected behavior
Expected: Console logs
Caught error
Actual Next 14: No console log
Actual Next 15: Console logs
Caught error
Provide environment information
Which area(s) are affected? (Select all that apply)
Middleware, Runtime
Which stage(s) are affected? (Select all that apply)
next dev (local), next start (local), Vercel (Deployed), Other (Deployed)
Additional context
This has been fixed sometime during Next 15 development. Some of my apps are currently stuck on Next 14 (due to dependencies that are still incompatible with React 19), so it would be really nice to have this fix in Next 14.
The text was updated successfully, but these errors were encountered: