question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Form component does not work after updating to Next12

See original GitHub issue

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?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:18 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
AndersGernercommented, Nov 15, 2021

@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!

1reaction
apiepcommented, Nov 9, 2021

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Upgrade Guide - Next.js
Upgrade Guide. Upgrading from 12 to 13. To update to Next.js version 13, run the following command using your preferred package manager:
Read more >
React-hook-form build problem when upgrading nextjs to ...
As David Cingolani mentioned, this problem was fixed in react-hook-form after version 7.22.5. To update the lib to the latest version run.
Read more >
Next.js 12.0.2 + Framer 5.0.1 leading to errors in production
I get the error SyntaxError: Named export 'set' not found. The requested module 'react-hook-form' is a CommonJS module, which may not support ...
Read more >
I Tried To Upgrade Next.js Without Crashing Production
In this video I take you along with me when I upgraded my own ... We will upgrade Next.js, fix any bugs or...
Read more >
Next.js 12 - 5 Changes You Should Pay Close Attention To ...
ES modules also run in the “strict” mode, outputting some smaller errors that otherwise JavaScript would not mind. When using CommonJS modules, developers...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found