Issue with ReadableStream is locked or disturbed error and Google Sign-In using Better Auth
Hi everyone!
I'm using Better Auth (version 0.5.2-beta.16) for a project, and I've encountered a blocking issue during Google sign-in integration.
My setup:
- Backend: Express with Drizzle ORM and Better Auth for authentication.
- Frontend: React using
createAuthClient
from Better Auth.
- Database: SQLite (with Drizzle ORM).
- Google OAuth for authentication.
Problem:
When trying to sign in with Google, the backend throws the following error:
Here’s the full log output:
This error happens when calling authClient.signIn.social({ provider: 'google', callbackURL: '/profile' })
on the frontend.
What I've tried:
- Checked that the Google OAuth credentials are correct.
- Ensured that the /api/auth/*
routes are properly handled in the backend using toNodeHandler
.
- Implemented CORS for requests between localhost:3000
(frontend) and localhost:5000
(backend).
- Verified that session middleware is correctly applied on the backend.
Here's a brief overview of my code:
- Frontend (React):
- Backend (Express):
5 Replies
Question:
- Has anyone else encountered this
ReadableStream is locked or disturbed
error when integrating Google sign-in with Better Auth?
- Could there be an issue with how I'm handling the request body in Express, or might there be something wrong with the internal stream handling in Better Auth?
Any help or suggestions would be greatly appreciated! Thank you in advance!GitHub
GitHub - jacksonkasi1/better-auth-example
Contribute to jacksonkasi1/better-auth-example development by creating an account on GitHub.

this is because you're using json middleware
which would read the body before the auth handler can get to it
If you remove that, it should work. Just apply the middleware to paths not handled by Better Auth.
@bekacru thanks it's work! 🙂