Ā© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•16mo ago•
8 replies
Ganbatte

Middleware Issues in Next.js Using Drizzle, Supabase, and NextAuth

Hi everyone! Is there anyone here who has successfully implemented middleware with Drizzle, Supabase, and NextAuth? I'm using Next.js.

I initially encountered this error: Reading from "cloudflare:sockets" is not handled by plugins (Unhandled scheme). However, after deleting and reinstalling the Postgres package, this error has disappeared.

Now, during login, I'm facing this issue:

[auth][error] JWTSessionError: Read more at https://errors.authjs.dev#jwtsessionerror
[auth][cause]: Error: The edge runtime does not support Node.js 'net' module.

Is it not possible to use Next.js, Drizzle, Supabase, and NextAuth in an edge environment within middleware? What am I doing wrong? My code is visible in the pictures. Thanks in advance for the help!
auth.png
middlewarev2.png
db.index.ts.png
drizzle-config.png
schema.ts.png
Auth.js | Errors
Authentication for the Web
Auth.js | Errors
Drizzle TeamJoin
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

[Solved] Issues with Middleware and Authentication in NextAuth.js with Drizzle and SQLite
Drizzle TeamDTDrizzle Team / help
14mo ago
Next.js, Drizzle and Supabase DB with transactions?
Drizzle TeamDTDrizzle Team / help
15mo ago
Setting up Drizzle with Supabase in Next.js App Router
Drizzle TeamDTDrizzle Team / help
3y ago
Using drizzle postgres with trpc in Next.js app
Drizzle TeamDTDrizzle Team / help
16mo ago