error TS2694: Namespace '".../node_modules/.prisma/client/index"' has no exported member 'BatchPayload'
See original GitHub issueBug description
When I use deleteMany, updateMany. Prisma support type named BatchPayload
but it has no exported.
How to reproduce
- Make any model, suppose
model Alarms
- CRUD model in
@nexus/schema
,t.crud.deleteManyAlarm();
tsc --noEmit
ortsc
@nexus/schema
generated types- Type Error in
BatchPayload: PrismaClient.BatchPayload;
- generated PrismaClient has
/**
* Batch Payload for updateMany & deleteMany
*/
export type BatchPayload = {
count: number
}
- However, I can’t import that.
Expected behavior
import * as PrismaClient from ".prisma/client"
no error Type namespace with PrismaClient.BatchPayload
Prisma information
model Alarm {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
title String
contents String
important Boolean @default(false)
read Boolean
alarmType AlarmType @default(ADVERTISEMENT)
advertisementBy Advertisement? @relation(fields: [advertisementById], references: [id])
advertisementById Int?
notificationBy Notification? @relation(fields: [notificationById], references: [id])
notificationById Int?
userBy User? @relation(fields: [userById], references: [id])
userById Int?
}
Environment & setup
- OS: Mac OS
- Database: MySQL
- Node.js version: 12.14.0
- Prisma version: 2.12.1
- @nexus/schema: 0.19.2
- nexus-plugin-prisma: 0.25.0
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Importing enum from @prisma/client gives the error "Module ...
ts:4:10 - error TS2305: Module '"@prisma/client"' has no exported member 'Modality'. I'm able to import PrismaClient and use it just fine in my ......
Read more >Generating the client (Concepts) - Prisma
This page explains how to generate Prisma Client. It also provides additional context on the generated client, typical workflows and Node.js configuration.
Read more >解决方法:重新安装@prisma/client - CSDN博客
node_modules /.prisma/client/index.d.ts:6:3 - error TS2305: Module '"./runtime"' has no exported member 'PrismaClientUnknownRequestError'.
Read more >jsbrain-prisma-nestjs-graphql - npm
Generate object types, inputs, args, etc. from prisma schema file for usage with @nestjs/graphql module. Latest version: 0.0.0-dev.13, ...
Read more >Prisma - Best of JS
Prisma Client can be used in any Node.js or TypeScript backend application (including ... which is exported by node_modules/@prisma/client/index.d.ts .
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sorry for necro-posting, I had the same issue and this was the first thread came from google search.
I solved it as follow:
import { Prisma } from '@prisma/client'
then you can reference it as
Prisma.BatchPayload
.Problem solved
I found problem in generated type in
@nexus/schema