prisma: I can't use `include` property in new version

Bug description

image

It shows an error when I use Include, I already renamed the DB schema to avoid conflicts with prisma, but I still can’t use the property

How to reproduce

Use include in new version

Expected behavior

No response

Prisma information


model user {
  Id_User                 Int       @id @unique(map: "Id$User$Unique") @default(autoincrement()) @map("Id$User")
  User_Nick               String    @map("User$Nick") @db.VarChar(120)
  User_Tag                String    @map("User$Tag") @db.Char(4)
  User_Type               String?   @default("1") @map("User$Type") @db.Char(1)
  User_Email              String    @unique(map: "User$Email") @map("User$Email") @db.VarChar(256)
  User_Password           String    @map("User$Password") @db.VarChar(256)
  User_Verified           String?   @default("N") @map("User$Verified") @db.Char(1)
  User_Verified_Log       String?   @default("00000000000000") @map("User$Verified$Log") @db.VarChar(256)
  User_Ban                String?   @default("N") @map("User$Ban") @db.Char(1)
  User_Ban_Log            String?   @default("00000000000000") @map("User$Ban$Log") @db.VarChar(256)
  User_Log_Desc           String    @map("User$Log$Desc") @db.VarChar(256)
  Created_At_Verified_Log DateTime? @map("Created$At$Verified$Log") @db.Timestamp(0)
  Created_At              DateTime  @default(now()) @map("Created$At") @db.Timestamp(0)
  Updated_At              DateTime  @default(now()) @map("Updated$At") @db.Timestamp(0)

  @@unique([User_Nick, User_Tag], map: "User$Nick$Tag")
}

const IdUser = await prismaClient.user.findUnique({
		where: {
			User_Email: userEmail,
		},
		include:{
			
		}
//error		
//Type '{}' is not assignable to type 'never'.ts(2322)
//searchUser.ts(15, 3): The expected type comes from property 'include' which is declared here on type '{ where: { User_Email: //string; }; include: never; }'

Environment & setup

  • OS: Windows 11
  • Database: MySQL
  • Node.js version: v16.17.0
  • Vs Code extension: v4.8.1

Prisma Version

prisma                  : 4.8.1
@prisma/client          : 4.8.1
Current platform        : windows
Query Engine (Node-API) : libquery-engine d6e67a83f971b175a593ccc12e15c4a757f93ffe (at node_modules\@prisma\engines\query_engine-windows.dll.node)
Migration Engine        : migration-engine-cli d6e67a83f971b175a593ccc12e15c4a757f93ffe (at node_modules\@prisma\engines\migration-engine-windows.exe)
Introspection Engine    : introspection-core d6e67a83f971b175a593ccc12e15c4a757f93ffe (at node_modules\@prisma\engines\introspection-engine-windows.exe)
Format Binary           : prisma-fmt d6e67a83f971b175a593ccc12e15c4a757f93ffe (at node_modules\@prisma\engines\prisma-fmt-windows.exe)
Format Wasm             : @prisma/prisma-fmt-wasm 4.8.0-61.d6e67a83f971b175a593ccc12e15c4a757f93ffe
Default Engines Hash    : d6e67a83f971b175a593ccc12e15c4a757f93ffe
Studio                  : 0.479.0

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Comments: 18 (7 by maintainers)

Most upvoted comments

Previously all includes work but now none work:

The following code returned all relations, now it is giving this error

	const Anime = await prismaClient.anime.findMany({
		take: get,//retorna o numero selecionando dos primeiros animes
		skip: skip,
		include: {
			anime_character: {
				select: {
					character: true
				}
			},
			episode: true,
			anime_synonym: {
				include: {
					media_synonym: true
				}
			},
			anime_genre: {
				include: {
					genre: true
				}
			},
			anime_image: {
				include: {
					url_image: true
				}
			},
			anime_public_type: {
				include: {
					public_type: true
				}
			},
			anime_type: true,
			exhibition_anime: {
				include: {
					exhibition: true
				}
			},
			magazine_anime: {
				include: {
					magazine: true
				}
			},
			anime_name: {
				include: {
					media_name: true
				}
			},

		}



	},