Skip to content

[Prisma Client] Duplicate identifier with models "X" and "XClient" #2539

@dodas

Description

@dodas

Consider following datamodel:

model Company {
   ...
}

model CompanyClient {
   ...
}

Prisma seem to generate class for each model, with Client appended to its name:

// this is corresponding to model "Company"
export declare class CompanyClient<T> implements Promise<T> {
  ...
}

//  this is corresponding to model "CompanyClient"
export declare class CompanyClientClient<T> implements Promise<T> {
  ...
}

..but it also generates type for each model, without appending anything to its name:

export type Company = {
   ...
} 

export type CompanyClient = {
   ...
} 

This leads to typescript error, as type CompanyClient is clashing with class CompanyClient:

Duplicate identifier 'CompanyClient'. ts(2300)

Naming convention for "Client" classes should be altered, probably..


Prisma CLI / client version: 2.0.0-beta.5

Metadata

Metadata

Assignees

Labels

bug/2-confirmedBug has been reproduced and confirmed.kind/bugA reported bug.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions