Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server action - Internal error not handled if middleware is used Server action does not finish request on file size exceeded error #73037

Open
liri2006 opened this issue Nov 21, 2024 · 0 comments
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.

Comments

@liri2006
Copy link

Link to the code that reproduces this issue

https://github.com/liri2006/next-file-upload-issue

To Reproduce

  1. Ensure app uses middleware.ts file
  2. Start the app
  3. Upload file > 1mb
  4. Submit form
  5. Check Network tab in browser

Current vs. Expected behavior

Expected:
Error is returned to the client.

Actual:
Request is in permanent "pending" state, so form submit never ends. Error is printed in server logs though .

Provide environment information

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Pro
  Available memory (MB): 32536
  Available CPU cores: 16
Binaries:
  Node: 22.11.0
  npm: 10.9.0
  Yarn: N/A
  pnpm: 9.12.3
Relevant Packages:
  next: 15.0.4-canary.21 // Latest available version is detected (15.0.4-canary.21).
  eslint-config-next: N/A
  react: 19.0.0-rc-380f5d67-20241113
  react-dom: 19.0.0-rc-380f5d67-20241113
  typescript: 5.3.3
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

Middleware, Runtime

Which stage(s) are affected? (Select all that apply)

next dev (local), Vercel (Deployed)

Additional context

Works as expected if middleware file is deleted.

@liri2006 liri2006 added the bug Issue was opened via the bug report template. label Nov 21, 2024
@github-actions github-actions bot added Middleware Related to Next.js Middleware. Runtime Related to Node.js or Edge Runtime with Next.js. labels Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

No branches or pull requests

1 participant