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

Progressively enhanced forms not working (405: not allowed) when deployed on vercel #58814

Closed
1 task done
timoclsn opened this issue Nov 23, 2023 · 2 comments · Fixed by #63978
Closed
1 task done

Progressively enhanced forms not working (405: not allowed) when deployed on vercel #58814

timoclsn opened this issue Nov 23, 2023 · 2 comments · Fixed by #63978
Labels
bug Issue was opened via the bug report template. locked

Comments

@timoclsn
Copy link

timoclsn commented Nov 23, 2023

Link to the code that reproduces this issue

https://github.com/timoclsn/next-forms-app

To Reproduce

  1. Visit examaple deployment: https://next-forms-app-beryl.vercel.app/
  2. Disable JavaScript in browser
  3. Submit the form

Current vs. Expected behavior

Submitting the p.e. form with JavaScript disabled doesn't work (405: not allowed).

This should work when deployed on Vercel.

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.1.0: Mon Oct  9 21:27:24 PDT 2023; root:xnu-10002.41.9~6/RELEASE_ARM64_T6000
Binaries:
  Node: 18.18.2
  npm: 9.8.1
  Yarn: 1.22.17
  pnpm: 8.9.2
Relevant Packages:
  next: 14.0.4-canary.11
  eslint-config-next: N/A
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.3.2
Next.js Config:
  output: N/A

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

App Router

Additional context

This happens when deployed on Vercel. It works locally (in dev and production mode).

@timoclsn timoclsn added the bug Issue was opened via the bug report template. label Nov 23, 2023
@timoclsn timoclsn changed the title Progressively enhanced forms not working on sub-paths (405: not allowed) when deployed on vercel Progressively enhanced forms not working (405: not allowed) when deployed on vercel Nov 25, 2023
@stevenmunro
Copy link

I'm chiming in because I'm encountering the same problem and I'm keen to stay updated on this discussion. It's imperative that we resolve this swiftly. It's not just about catering to users without JavaScript enabled; it's also about ensuring the integrity of our code. There's a chance there's an issue with my code, and I want to address it promptly to avoid potential future complications.

ztanner added a commit that referenced this issue Apr 2, 2024
…ployed (#63978)

Trying to submit a server action when JS is disabled (ie, no action
header in the request, and in the "progressively enhanced" case) for a
static resource results in a 405 error when deployed to Vercel. In the
absence of an action ID header, the request content-type is used to
signal that it shouldn't try and hit the static cache. However with
multipart/form-data, this will include the boundary. This updates the
matcher to consider a boundary string.

Fixes #58814
Closes NEXT-2980
Copy link
Contributor

This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template. locked
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants