-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Intermittent Failure: request to http://localhost:3000/api/auth/session failed, reason: read ECONNRESET #4553
Comments
We've been having the same issue. As far as I can tell we only start getting this error after upgrading Out of interest, are you using |
Hi @sudo-jaa! Yes, we're using swc. It's so fast :) |
@mopatches I agree - SWC is definitely a great tool! Though there do seem to be situations where it can cause some issues. I remember our first stab at transition to nextjs 12 and SWC from babel had some issues where compilation was panicking due to a recursion depth limit - at least during the minification process. They did end up managing to fix it a few updates in, but it makes me think that it might, under certain circumstances, output imperfect transpiled / minified code. That said, the people who maintain next and swc are way smarter than I could ever hope to be, so this isn't an accusation or anything that there might be a bug there! But it might be an interesting thread to pull to see if it resolves your issue. If falling back to babel/next 11 solves your issue, then that's probably really useful information to be able to supply to the maintainers of next-auth. If not then we could rule it out. Like I said - in our case this issue only started after bumping to nextjs 12 🤔 |
I have the same issue. I also had it on NextJS 11 but less frequent. I have custom _document.tsx and _app.tsx with SessionProvider. |
I'm having a similar issue locally on the same endpoint (
Environment
I opened a separate issue #4584 |
I'm having a similar problem, I opened a separate issue: #4590 |
@simonecervini , @stevenspads, @huksley, @mopatches can I ask if you guys are using next-auth |
Hello @royletron! I'm using next-auth v4 (currently v4.3.4). |
@mopatches is your |
Hello @royletron! I'm using v4.3.4 with mongodb-adapter v1.0.0 |
@royletron yes, my adapter is Prisma. |
@royletron I'm using |
I am using nextJS 12, next-auth 4 I am using a It is nice to have a unified API but server-side implementation should tap directly into backend without extra HTTP hop. |
Unfortunately, this does not sound like we can do much about it as there is no clear reproduction. #4116 might help with this in the future, depending on your use case, but without code, it's hard to tell if that's even a related problem. |
Environment
Reproduction URL
None
Describe the issue
Hello! My NextJS app works great most of the time, but intermittently fails on /api calls due to an exception in next-auth. The exception happens in dev and prod/precompiled mode. I haven't found a consistent repro to cause the exception:
The browser sees this exception as a 401, but it able to retry and the second request works without issue.
Any guidance on what to try would be very welcome. Thank you!
How to reproduce
Calling /api routes from within a setInterval seems to trigger the exception every few minutes. The exception appears more likely to trigger in dev mode with the server recompiling server-side code often.
Expected behavior
No exception, or the ability to catch and retry server-side.
The text was updated successfully, but these errors were encountered: