Any help here is appreciated! Running into an issue when attempt to deploy. I'm running locally to resolve issues and this is what I've found:
- Npx only allow ppm
- pnpm install // to install dependencies
- Pnpm generate // doesn’t throw errors
- Pnpm migrate dev // doesn’t throw errors
- Pnpm build // runs tsc -p tsconfig.json
- This throws the error that the types aren’t found
generator client {
provider = "prisma-client-js"
output = "../node_modules/.prisma/client"
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
generator typescriptInterfaces {
provider = "prisma-generator-typescript-interfaces"
output = "../src/shared/models/entities.ts"
modelType = "type"
enumType = "enum"
prettier = true
}
When I remove the output line - I still get the same error.
import { Prisma } from '@prisma/client';
import { DBContext } from '../../db.context';
import { AddressCreateInputDto } from '../../../types/DTOs/address.dtos';
import { injectable } from 'inversify';
import { Address } from '../../../shared/models/entities'; //generator output
@injectable()
export class AddressRepo {
constructor(private readonly _db: DBContext) {
this._db = _db;
}
public async create(address: AddressCreateInputDto): Promise<Address> {
const newAddress = await this._db.prisma.address.create({ data: address as Prisma.AddressCreateInput });
return newAddress;
}
export type Address = {
id: string;
name: string;
… // rest of the fields
}
```;
So I know the types exist in the code base. Is there an extra step needed to ensure prisma can find the generated types?