ClsPluginModule Error #120
-
|
When I register the ClsModule in app.module.ts like in the documentation: It gives the following error In my prisma module I have something like this: prisma.service.ts I don't really know which problem is, if someone could give any clue I'd appreciate. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
|
Before going any further, please see if you're on the latest versions of If that does not help, I'd like to ask you to share a minimal reproduction so I can investigate. |
Beta Was this translation helpful? Give feedback.
-
|
Hi guys, I have the exact same error message as you but using the part of app.module.ts imports section looks like: and in database.module.ts looks like: I'm new to in nestjs and have already spent two days trying to figure out how to make it work, so any help would be greatly appreciated |
Beta Was this translation helpful? Give feedback.
@PazminoJose Thank you for the reproduction, I have tried it locally and now I see where the problem is.
In your
PrismaModule, you're providing thePrimsaService, which is an extendedPrismaClient.You pass
PrismaClientasprismaInjectionTokento theTransactionalAdapterPrisma, but there is nothing provided under thePrismaClientinjection token (which is the "argument t at index [0]").So the fix to your problem is the following simple change:
adapter: new TransactionalAdapterPrisma({ - prismaInjectionToken: PrismaClient + prismaInjectionToken: PrismaService })I'll go ahead and clarify it in the docs so it doesn't confuse people.