Comments (4)
Thanks for the prompt reply and sorry for me being a little sluggish with mine.
I believe I am not calling Prisma from the middleware or any other place that can potentially have the edge runtime turned on. This is my middleware.ts
code (pretty much the only place something may break at) - it was configured with accordance to the Edge Compatibility
page recommendations from NextAuth docs:
import { authConfig } from '@/config/auth/config'
import { DEFAULT_LOCALE, LOCALES, LOCALE_PREFIX_STRATEGY } from '@/config/intl'
import NextAuth from 'next-auth'
import createI18nMiddleware from 'next-intl/middleware'
const { auth } = NextAuth(authConfig)
const rerouteByLocale = createI18nMiddleware({
locales: LOCALES,
defaultLocale: DEFAULT_LOCALE,
localePrefix: LOCALE_PREFIX_STRATEGY,
})
export const middleware = auth(request => rerouteByLocale(request))
export const config = {
matcher: ['/((?!api|_next/static|_next/image|favicon.ico).*)'],
}
Therefore, I believe it's actually the second option that is taking place, and I will try to provide a reproduction example ASAP
from prisma.
Getting the same error after trying to call $use
instead in this fashion:
const getClient = () => {
const client = new PrismaClient()
client.$use(async (params, next) => {
const before = Date.now()
const result = await next(params)
const after = Date.now()
console.log(
`Query ${params.model}.${params.action} with ${params.args} took ${after - before}ms`,
)
return result
})
return client
}
from prisma.
$extends
call errors out as well
from prisma.
Where are you trying to use Prisma Client?
Next.js middleware for example is unfortunately always executed in the edge runtime of Vercel, even when running it locally via next dev
or similar (see a massive discussion about this here: vercel/next.js#46722), which means you really have to follow these instructions to be able to talk to a database. In that case, this is not related to $on
or $use
at all and we unfortunately can't do much besides showing the instructions you are seeing.
If you are not trying to use it in middleware or anything similar that runs in the edge runtime, this is a false positive of our detection code. For that case, a reproduction repository with a minimal Next.js app and the absolutely needed code that is needed to trigger this situation would be the best way forward.
from prisma.
Related Issues (20)
- "Invalid params: invalid type: map, expected a string" when prisma push HOT 1
- Relative paths in datasource URL handled differently with prismaSchemaFolder preview feature
- `.$extends` prevents typescript documentation HOT 1
- Testing Accelerate caching behavior locally
- TypeScript says PrismaClient can't receive `omit` property (enabled in client) HOT 1
- Client extensions cannot support Fluent API
- Direct Query Support for Nested Field Extraction in Prisma
- Prisma Seed Script Fails After Upgrading to v5.16.0 (DATABASE_URL Error) HOT 6
- $queryRaw ignores `schema` when using @prisma/adapter-pg
- Weird errors in prisma when my RDS DB scales down
- internal error: entered unreachable code
- "prismaSchemaFolder" doesn't exist
- Generated JSON query is incorrect HOT 1
- nextjs app deployed to vercel edge can't import prisma WASM module HOT 3
- Next generations HOT 1
- Prisma Studio localhost:5555 screen is not visible properly when i try to delete something
- Migrations trying to drop my custom-defined SEQUENCE
- Postinstall fails in Bun environment using `bun prisma generate`, bun x prisma generate`, etc. HOT 1
- Inconsistent handling of default values for Mongodb
- Feature Request: Compare to Value from another level of where
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.