1

Before I do npm install @prisma/client I get an error:

Cannot find module '@prisma/client' or its corresponding type declarations.ts(2307)

in the code below

import { Injectable, OnModuleInit } from '@nestjs/common';
import { PrismaClient } from '@prisma/client';

@Injectable()
export class DatabaseService extends PrismaClient implements OnModuleInit {
  async onModuleInit() {
    await this.$connect();
  }
}

After the installation of @prisma/client I get an error

ERROR [ExceptionHandler] @prisma/client did not initialize yet. Please run "prisma generate" and try to import it again.

Thanks in Advance.

I tried to install @prisma/client package

1 Answer 1

1

correct your PrismaClient import to

import { PrismaClient } from "@/generated/prisma";
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.