[next.config.js rewrites] Error: socket hang up
See original GitHub issueVerify canary release
- I verified that the issue exists in Next.js canary release
Provide environment information
Operating System:
Platform: linux
Arch: x64
Version: #1 SMP Wed Oct 28 23:40:43 UTC 2020
Binaries:
Node: 16.13.1
npm: 8.1.2
Yarn: N/A
pnpm: N/A
Relevant packages:
next: 12.1.5
react: 17.0.2
react-dom: 17.0.2
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Describe the Bug
When using rewrites it’s impossible to make a request to API endpoint that takes more than 30 seconds to respond. After 31 second Next just throws the error Server Error Error: socket hang up
which makes it impossible to use with any responding APIs.
Expected Behavior
There should be a soft timeout which would not throw after 30 seconds but should proceed waiting for the response and only show a warning. Or provide additional option to set custom timeouts.
To Reproduce
Create a rewrite rule to the endpoint which responds more than 30 seconds.
Issue Analytics
- State:
- Created a year ago
- Reactions:13
- Comments:45 (3 by maintainers)
Top Results From Across the Web
NodeJS - What does "socket hang up" actually mean?
It means that socket does not send connection end event within the timeout period. If you are getting the request for cheerio via...
Read more >Hang in There! (A solution to socket hang up) - Medium
So, I set about playing with the settings to varying degrees of nothing. It was frustrating, but undeterred I moved on to the...
Read more >Problems parameters dynamic routes : r/nextjs - Reddit
Hello community I have problems passing my dynamic path parameters to my component, I am using getStaticPaths and getStaticProps, ...
Read more >Errors – Vercel Docs
A list of errors provided by Vercel CLI or the REST API, with details on how they ... Next.js automatically handles the other...
Read more >Kibana Server is Not Yet Ready - Elastic Discuss
I have trouble setting up my ELK stack as I have faced an issue ... basePath: "" # Specifies whether Kibana should rewrite...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Same issue here!
To add some additional details, this is happening to me sporadically without any rewrites off latest (12.2.3). I can try canary later today. It’s sporadic, but I’m more likely to see it right after server start.
And it is happening to me in production. I saw it some Sentry logs this morning. Hope some of this helps