i am new in typescript, when i try to run my docker-compose up command, i am getting this error, i am using es7
TypeError: Class constructor PrismaClient cannot be invoked without 'new'
can anyone please help me why i am getting this error ? any help will be really appreciated, here i have added my code for it,
import { Injectable, OnInit, OnDestroy } from "@tsed/di";
import { PrismaClient } from "@prisma/client";
@Injectable()
export class PrismaService extends PrismaClient implements OnInit, OnDestroy {
async $onInit() {
await this.$connect();
}
async $onDestroy() {
await this.$disconnect();
}
}
2
Answers
change in tsconfig file
Out prisma.service.ts looks like this:
And in tsconfig.json we have the following:
Hope this helps.