next-runtime: Form component does not work after updating to Next12

Thanks for a great library! Really love this!

After updating to Next12, using the Form component, which sets the header: “Accept”: “application/json”, this request are just pending. using the normal HTML “form” element still works. If you make a post request, without the “accept” header, the text/html is returned with the expected data from the handler in the next/script at the bottom.

I have created this repository to help reproduce the error: https://github.com/AndersGerner/Next12RuntimeFormError

I have tried to google and look around but I am unfortunately not able to help - Hoping you guys have an idea on this issue 😃

UPDATE: Maybe not the Form that is the problem. Using the example CURL request: curl -H "Accept: application/json" https://example.com/page-path is also pending. So maybe it’s the handler?

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 18 (10 by maintainers)

Most upvoted comments

@smeijer YEEES!!! YOU ARE THE MAN!

2.3.2 works! Thank you! I have tested both in my project and in the test-repo and it just works perfectly now!

What about using redirect.statusCode property when returning object from getServerSideProps? Like shown in this documentation https://nextjs.org/docs/basic-features/data-fetching#getserversideprops-server-side-rendering