Skip to content

[BUG] Submitting images over 1MB results in unhelpful error message #654

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

Open
Karibash opened this issue May 8, 2025 · 5 comments
Open
Labels
bug Something isn't working needs repro triage

Comments

@Karibash
Copy link

Karibash commented May 8, 2025

Describe the bug

When attempting to submit an image larger than 1MB through the form, an error occurs with the message:
Promise will never complete
No additional context is provided, making it difficult to understand the cause of the issue.

This error happens immediately upon clicking the Submit button.

Steps to reproduce

Minimal reproduction repository:
https://github.com/Karibash/opennextjs-submit-error

  1. Open the deployed demo:
    https://opennextjs-submit-error.looks-to-me.workers.dev/
  2. Select an image larger than 1MB
  3. Click Submit
  4. Observe the error: Promise will never complete

Expected behavior

Expect to be able to upload files larger than 1 MB.

@opennextjs/cloudflare version

1.0.1

Wrangler version

4.14.1

next info output

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.4.0: Fri Apr 11 18:33:47 PDT 2025; root:xnu-11417.101.15~117/RELEASE_ARM64_T6030
  Available memory (MB): 36864
  Available CPU cores: 11
Binaries:
  Node: 22.15.0
  npm: 10.9.2
  Yarn: N/A
  pnpm: 10.10.0
Relevant Packages:
  next: 15.1.7 // There is a newer version (15.3.2) available, upgrade recommended!
  eslint-config-next: N/A
  react: 19.1.0
  react-dom: 19.1.0
  typescript: 5.8.3
Next.js Config:
  output: N/A
 ⚠ There is a newer version (15.3.2) available, upgrade recommended!
   Please try the latest canary version (`npm install next@canary`) to confirm the issue still exists before creating a new issue.
   Read more - https://nextjs.org/docs/messages/opening-an-issue

Additional context

I did not get this error with next-on-pages.
Is this a limitation of Workers?

@Karibash Karibash added bug Something isn't working triage labels May 8, 2025
@vicb
Copy link
Contributor

vicb commented May 8, 2025

Could you please share a minimal repro (link to a GH repository with the source code).
There is no way we can help without that.

@Karibash
Copy link
Author

Karibash commented May 9, 2025

@vicb
I have created a minimal repository that reproduces the issue:
https://github.com/Karibash/opennextjs-submit-error

You can try it from the following URL:
https://opennextjs-submit-error.looks-to-me.workers.dev/

@sommeeeer
Copy link

sommeeeer commented May 9, 2025

https://nextjs.org/docs/app/api-reference/config/next-config-js/serverActions#bodysizelimit - Set this to the size you want as max.

It should probably not exceed 100mb, as that is the limit for request payloads in workers. You can read more about Workers Request Limits here

@Karibash
Copy link
Author

Karibash commented May 9, 2025

@sommeeeer
Ahhh, thank you so much!
I completely overlooked that setting — what a careless mistake on my part. I really appreciate your help!

@Karibash Karibash closed this as completed May 9, 2025
@vicb
Copy link
Contributor

vicb commented May 9, 2025

@Karibash "Promise will never complete" is not a great UX, keeping the issue opened until we can take a look

@vicb vicb reopened this May 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs repro triage
Projects
None yet
Development

No branches or pull requests

3 participants