P
Prisma2mo ago
Nykaula

Core Prisma types (like Middleware Params) unresolved in V6.16.3

Hello everyone, I'm running into a persistent TypeScript type resolution issue with Prisma and I'm hoping for some insight. The Problem Core Prisma types, such as Prisma.MiddlewareParams, are not being resolved when using version 6.16.3. The TypeScript compiler (tsc) fails with the error TS2694: Namespace 'Prisma' has no exported member 'MiddlewareParams', even in a completely clean project. Environment - OS: Windows - Node.js: v22.19.0 - npm: 10.9.3 - Prisma Version (Failing): 6.16.3 - Prisma Version (Working): 5.17.0 Steps to Reproduce I can reliably reproduce this with a minimal setup: 1. Initialize a new ES Module TypeScript project:
npm init -y
npm install typescript @types/node --save-dev
npx tsc --init

npm init -y
npm install typescript @types/node --save-dev
npx tsc --init

2. In package.json, add "type": "module". 3. In tsconfig.json, ensure these options are set:
"module": "NodeNext",
"moduleResolution": "NodeNext"

"module": "NodeNext",
"moduleResolution": "NodeNext"

4. Install the latest Prisma version:
npm install prisma@6.16.3 @prisma/client@6.16.3
npx prisma init

npm install prisma@6.16.3 @prisma/client@6.16.3
npx prisma init

5. Use a minimal schema.prisma:
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
model User {
id String @id @default(uuid())
email String @unique
}

generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
model User {
id String @id @default(uuid())
email String @unique
}

6. Generate the client with npx prisma generate. 7. Create a test.ts file:
import { Prisma } from '@prisma/client';

const myFunc = (params: Prisma.MiddlewareParams) => {
console.log(params.model);
};

import { Prisma } from '@prisma/client';

const myFunc = (params: Prisma.MiddlewareParams) => {
console.log(params.model);
};

8. Running npx tsc --noEmit fails with the TS2694 error. Conclusion & Workaround Interestingly, the issue is completely resolved by downgrading to 5.17.0. After running npm install prisma@5.17.0 @prisma/client@5.17.0 and regenerating, the npx tsc command passes with zero errors. I have not tested every intermediate version, but I can confirm the issue is present in 6.16.3 and absent in 5.17.0. This seems to point to a potential bug or incompatibility in the latest version, perhaps specific to the Node.js v22 + Windows environment. Has anyone else seen this? Thanks for any help!
4 Replies
Prisma AI Help
Prisma AI Help2mo ago
You selected the carefully hand-crafted route. A dev artisan will respond soon. Meanwhile, the #ask-ai channel awaits if you're curious!
Nykaula
NykaulaOP2mo ago
After more work on it, I realized this is the old way to do what I wanted and now I have to use Prisma Extension. I had gotten lost in the docs and somewhere they used the old method which I chose to follow which led me down the wrong path.
Nurul
Nurul2mo ago
Could you share with me the docs you followed? So that we can investigate if we can improve the docs
Nykaula
NykaulaOP2mo ago
I started looking for a way to do logs with Prisma and I found this page : https://www.prisma.io/docs/orm/prisma-client/client-extensions/middleware/logging-middleware It doesn't say on it that the method has been removed but it says so here : https://www.prisma.io/docs/orm/prisma-client/client-extensions/middleware
Middleware sample: logging (Reference) | Prisma Documentation
How to use middleware to log the time taken to perform any query.
Middleware (Reference) | Prisma Documentation
Prisma Client middleware allows you to perform actions before or after any query on any model with the prisma.$use method.

Did you find this page helpful?