-
-
Notifications
You must be signed in to change notification settings - Fork 58
Open
Description
Hello,
I'm using nestjs-prisma in an application, and I have an e2e test failing when an exception is launched because the applicationRef inside this lib is undefined.
Steps to reproduce:
- Write an e2e test where you expect an exception to be raised using the
findFirstOrThrowinside a nest service and call it through the controller.
Expected behavior:
The test passes without issues.
What is happening:
The exception is properly raised, however, the applicationRef is undefined making the test hang with:
TypeError: Cannot read properties of undefined (reading 'isHeadersSent')
at PrismaClientExceptionFilter.catch (node_modules/@nestjs/core/exceptions/base-exception-filter.js:27:29)
at PrismaClientExceptionFilter.catchClientKnownRequestError (node_modules/nestjs-prisma/lib/prisma-client-exception.filter.ts:88:6)
at PrismaClientExceptionFilter.catch (node_modules/nestjs-prisma/lib/prisma-client-exception.filter.ts:69:4)
at ExceptionsHandler.invokeCustomFilters (node_modules/@nestjs/core/exceptions/exceptions-handler.js:33:26)
at ExceptionsHandler.next (node_modules/@nestjs/core/exceptions/exceptions-handler.js:13:18)
at node_modules/@nestjs/core/router/router-proxy.js:13:35
This issue does not happen in runtime.
Here is a thread on the NestJS discord server discussing about this bug.
Metadata
Metadata
Assignees
Labels
No labels