Comments (6)
Interesting
from prisma.
Same here !
Initially I had this problem :
[auth][error] AdapterError: Read more at https://errors.authjs.dev#adaptererror
[auth][cause]: Error: PrismaClient is not configured to run in Vercel Edge Functions or Edge Middleware. In order to run Prisma Client on edge runtime, either:
- Use Prisma Accelerate: https://pris.ly/d/accelerate
- Use Driver Adapters: https://pris.ly/d/driver-adapters
If this is unexpected, please open an issue: https://pris.ly/prisma-prisma-bug-report
at Object.get (webpack-internal:///(middleware)/./node_modules/.prisma/client/index-browser.js:207:15)
at getSessionAndUser (webpack-internal:///(middleware)/./node_modules/@auth/prisma-adapter/index.js:240:44)
at acc. (webpack-internal:///(middleware)/./node_modules/@auth/core/lib/init.js:178:30)
at Module.session (webpack-internal:///(middleware)/./node_modules/@auth/core/lib/actions/session.js:67:36)
at AuthInternal (webpack-internal:///(middleware)/./node_modules/@auth/core/lib/index.js:47:77)
at async Auth (webpack-internal:///(middleware)/./node_modules/@auth/core/index.js:126:34)
at async handleAuth (webpack-internal:///(middleware)/./node_modules/next-auth/lib/index.js:134:29)
at async adapter (webpack-internal:///(middleware)/./node_modules/next/dist/esm/server/web/adapter.js:179:16)
at async C:\Code\iot-project\node_modules\next\dist\server\web\sandbox\sandbox.js:110:22
at async runWithTaggedErrors (C:\Code\iot-project\node_modules\next\dist\server\web\sandbox\sandbox.js:107:9)
[auth][details]: {}
[auth][error] SessionTokenError: Read more at https://errors.authjs.dev#sessiontokenerror
[auth][cause]: Error: PrismaClient is not configured to run in Vercel Edge Functions or Edge Middleware. In order to run Prisma Client on edge runtime, either:
- Use Prisma Accelerate: https://pris.ly/d/accelerate
- Use Driver Adapters: https://pris.ly/d/driver-adapters
If this is unexpected, please open an issue: https://pris.ly/prisma-prisma-bug-report
at Object.get (webpack-internal:///(middleware)/./node_modules/.prisma/client/index-browser.js:207:15)
at getSessionAndUser (webpack-internal:///(middleware)/./node_modules/@auth/prisma-adapter/index.js:240:44)
at acc. (webpack-internal:///(middleware)/./node_modules/@auth/core/lib/init.js:178:30)
at Module.session (webpack-internal:///(middleware)/./node_modules/@auth/core/lib/actions/session.js:67:36)
at AuthInternal (webpack-internal:///(middleware)/./node_modules/@auth/core/lib/index.js:47:77)
at async Auth (webpack-internal:///(middleware)/./node_modules/@auth/core/index.js:126:34)
at async handleAuth (webpack-internal:///(middleware)/./node_modules/next-auth/lib/index.js:134:29)
at async adapter (webpack-internal:///(middleware)/./node_modules/next/dist/esm/server/web/adapter.js:179:16)
at async C:\Code\iot-project\node_modules\next\dist\server\web\sandbox\sandbox.js:110:22
at async runWithTaggedErrors (C:\Code\iot-project\node_modules\next\dist\server\web\sandbox\sandbox.js:107:9)
[auth][details]: {}
I don't know why because I never tried to use the edge.
So then, i tried to use the neon edge adapter and got the same error as you...
from prisma.
Does this cause any problems or error, or is this just a warning?
from prisma.
It is a warn, but at the end of so many calls or restarts of the page, sometimes it does not restart and I have to restart the server, already in turbo mode because the warn does not appear.
from prisma.
I just found out something !
I downgraded next-auth to version 4.24.3 and I have the same error message than the one I posted to abose when I try to use the Nextjs Middleware.
So the problem might come from the fact that the middleware is suppose to run on the edge or something like that and that the prisma adapter is not made for that !
Middleware
import { withAuth } from "next-auth/middleware";
import prisma from "./db";
export default withAuth(
// `withAuth` augments your `Request` with the user's token.
function middleware(req) {
console.log(req.nextauth.token);
},
{
callbacks: {
authorized: async ({ req: { cookies } }) => {
const sessionToken = cookies.get("next-auth.session-token")?.value;
const user = await prisma.session
.findUnique({ where: { sessionToken } })
.user();
console.log(user?.isAdmin);
return sessionToken != null;
},
},
}
);
Error
⨯ Error: PrismaClient is not configured to run in Vercel Edge Functions or Edge Middleware. In order to run Prisma Client on edge runtime, either:
- Use Prisma Accelerate: https://pris.ly/d/accelerate
- Use Driver Adapters: https://pris.ly/d/driver-adapters
If this is unexpected, please open an issue: https://pris.ly/prisma-prisma-bug-report
at Object.get (webpack-internal:///(middleware)/./node_modules/.prisma/client/index-browser.js:207:15)
at Object.authorized (webpack-internal:///(middleware)/./src/middleware.ts:18:76)
at handleMiddleware (webpack-internal:///(middleware)/./node_modules/next-auth/next/middleware.js:50:334)
at async Object.options [as handler] (webpack-internal:///(middleware)/./node_modules/next-auth/next/middleware.js:68:31)
at async adapter (webpack-internal:///(middleware)/./node_modules/next/dist/esm/server/web/adapter.js:179:16)
at async (file://C:\Code\iot-project\node_modules\next\dist\server\web\sandbox\sandbox.js:110:22)
at async runWithTaggedErrors (file://C:\Code\iot-project\node_modules\next\dist\server\web\sandbox\sandbox.js:107:9)
at async DevServer.runMiddleware (file://C:\Code\iot-project\node_modules\next\dist\server\next-server.js:1062:24)
at async DevServer.runMiddleware (file://C:\Code\iot-project\node_modules\next\dist\server\dev\next-dev-server.js:268:28)
at async NextNodeServer.handleCatchallMiddlewareRequest (file://C:\Code\iot-project\node_modules\next\dist\server\next-server.js:324:26)
from prisma.
@Hugo-Lorenzoni Well, if you are using neon serverless it works, everything and remove the prism warn from the edge functions, and that works but sometimes the Edge Functions invocations are not completed because of the async await, in the middleware it can serve as protecting routes, I I solved it by removing the middleware, since I won't need it for the moment, but I think it's a Prisma adapter error
from prisma.
Related Issues (20)
- ConnectorError(ConnectorError { user_facing_error: None, kind: QueryError(PostgresError { code: "42P05", message: "prepared statement \"s0\" already exists", severity: "ERROR", detail: None, column: None, hint: None }), transient: false })]
- How to Perform Group By with Date Extraction in Prisma
- Unable to require libquery_engine-debian-openssl-3.0.x.so.node HOT 2
- Hello @bso-oo 👋 HOT 2
- Run Prisma on docker use elysia/Bun js HOT 1
- Inconsistent column data: Malformed ObjectID: provided hex string representation must be exactly 12 bytes, instead got HOT 2
- Support for manually managing prepared statements HOT 5
- Migration failed to apply cleanly to shadow database HOT 3
- VSCode Autocomplete Not Functioning When Extending Prisma Schema HOT 2
- Prisma Migrate Drops Custom Migrations HOT 5
- Types broken on void clients (no models) HOT 2
- RustPanic: RuntimeError HOT 1
- internal error: entered unreachable code HOT 1
- I'm using using prisma in auth.config.ts and Its giving vercel edge errors
- When using `pnpm` and deploying Prisma Client to Heroku, it fails at runtime with `Cannot find module '.prisma/client'` HOT 2
- Install fail! Error: [[email protected] › @prisma/[email protected]] Can't find package @prisma/engines's version: 5.14.0
- Error seeding DB via Prisma command, possible invocation error
- Bug: Migrations not compatible with D1 HOT 2
- Query optimization is not compatible with PostgreSQL citext fields HOT 2
- PrismaClientInitializationError HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prisma.