Issue with SSO Authentication Using OpenNext and Better-Auth

I have deployed a Next.js application using OpenNext and implemented SSO authentication with Better-Auth and Prisma. It works correctly in my local environment, but when I run the application with the "preview" and "deploy" commands, I encounter a 500 error on the request:
POST https://x.x.workers.dev/api/auth/sign-in/social
POST https://x.x.workers.dev/api/auth/sign-in/social
Enabling the Workers logs allowed me to see the error message, which is:
# SERVER_ERROR: Error: [unenv] fs.readdir is not implemented yet!
# SERVER_ERROR: Error: [unenv] fs.readdir is not implemented yet!
However, I am unable to determine where fs.readdir is being used, as I do not directly use the fs package in my code. It appears that one of my dependencies is calling fs.readdir. Could someone advise on how to identify the package or code that is invoking fs.readdir and provide any suggestions for working around or resolving this error?
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?