Open KennyMwendwaX opened 4 months ago
Same here, tried with both node v18 and v20. I am on latest Next.js 14.1 and Drizzle 0.30.4
I think it's because the edge
runtime is not supported. I had export runtime = 'edge'
in one of my routes using the DB. After removing it it worked.
middleware.ts
is always using edge
.
same here. i was hoping it supports edge runtime
I just contributed to the bounty on this issue.
Each contribution to this bounty has an expiry time and will be auto-refunded to the contributor if the issue is not solved before then.
To make this a public bounty or have a reward split, the maintainer can reply to this comment.
I have a similar problem in my middleware.ts. My error message is:
[auth][error] AdapterError: Read more at [https://errors.authjs.dev#adaptererror](https://errors.authjs.dev/#adaptererror)
[auth][cause]: Error: The edge runtime does not support Node.js 'net' module.
Learn More: https://nextjs.org/docs/messages/node-module-in-edge-runtime
at Object.apply (webpack-internal:///(middleware)/./node_modules/next/dist/esm/server/web/globals.js:43:19)
at createSocket (webpack-internal:///(middleware)/./node_modules/postgres/src/connection.js:146:44)
at Timeout.connect [as _onTimeout] (webpack-internal:///(middleware)/./node_modules/postgres/src/connection.js:343:31)
at listOnTimeout (node:internal/timers:573:17)
at process.processTimers (node:internal/timers:514:7)
[auth][error] SessionTokenError: Read more at [https://errors.authjs.dev#sessiontokenerror](https://errors.authjs.dev/#sessiontokenerror)
[auth][cause]: Error: The edge runtime does not support Node.js 'net' module.
Learn More: https://nextjs.org/docs/messages/node-module-in-edge-runtime
at Object.apply (webpack-internal:///(middleware)/./node_modules/next/dist/esm/server/web/globals.js:43:19)
at createSocket (webpack-internal:///(middleware)/./node_modules/postgres/src/connection.js:146:44)
at Timeout.connect [as _onTimeout] (webpack-internal:///(middleware)/./node_modules/postgres/src/connection.js:343:31)
at listOnTimeout (node:internal/timers:573:17)
at process.processTimers (node:internal/timers:514:7)
Just ran into this issue, found a fix. It's somwhere between 2:05:00 and 2:23:00 in https://www.youtube.com/watch?v=1MTyCvS05V4&list=WL&index=58&t=109s&ab_channel=CodeWithAntonio
Just ran into this issue, found a fix. It's somwhere between 2:05:00 and 2:23:00 in https://www.youtube.com/watch?v=1MTyCvS05V4&list=WL&index=58&t=109s&ab_channel=CodeWithAntonio The issue that he solves in that timeframe is no auth secret, i did not see the current issue pop up because he is using the neo db drver instead of the postgres driver
The solution in the video starts at 2:18:49 https://www.youtube.com/watch?v=1MTyCvS05V4&t=8327s
Description: I am encountering an issue while using postgres.js with Drizzle ORM in a Next.js authentication application. Despite not using Cloudflare Workers in my project, I'm encountering an error related to "cloudflare:sockets", indicating an UnhandledSchemeError.
Here's a summary of the relevant code and context:
The error message received is: