Pipe that decorates a body object without specified property has incorrect value
I have a custom pipe that original was used to parse a string from a route param such as “###-###” to an object with two properties equaling the values parsed.
Dependency undefined unless @Inject() used
I’m running into a very troubling issue with NestJS and dependency injection.
`forwardRef` does not work for modules created by `Test` factory from `@nestjs/testing`
I have got an issue that I met in your GitHub issues.
I can not create a testing module Test.createTestingModule
for testing that uses circular dependency.
Here https://github.com/nestjs/nest/issues/4688 I read the reason why it is a bad idea and why we should avoid it.
The main point is that it is a unity test, and we should not use forwardRef
we need to build a test bad and mock. The author of the issue described that he needed it for e2e tests. I like to write tests in an integration style like e2e does and check and develop the real functionality. I also need to support forwardRef
. For me, it looks like createTestingModule
does not support forwardRef
wrapper. My opinion is that it has to be because it is a part of the core. I am covering this by testing a service with many convoluted dependencies. It becomes a hell to describe it. Yes, we can create a helper factory. But it is also a problem to support it. I am looking for an elegant solution. I would like to do it without code refactoring. But for now, it is impossible.
Regards.
I have an error with my application on Nest JS. This app consist in an Auth module with Register and Login methods
When I run my app, it runs without problems but when I try to register an user I obtain an “Internal server error 500”.
Can’t resolve Cache even though the module is being globally imported
I’m using NestJS 10.0.0, with @nestjs/cache-manager
=2.2.2 and cache-manager
=5.5.2 and cache-manager-redis-yet
=5.0.0. However, as the title says, I’m encountering an issue where I can’t make it instantiate inside any service, even though I’ve set global parameter for CacheModule
.
NestJS – Can’t resolve Cache even though the module is being globally imported
I’m using NestJS 10.0.0, with @nestjs/cache-manager
=2.2.2 and cache-manager
=5.5.2 and cache-manager-redis-yet
=5.0.0. However, as the title says, I’m encountering an issue where I can’t make it instantiate inside any service, even though I’ve set global parameter for CacheModule
.
How to write NestJS callback that wraps around all incoming HTTP requests
How can I get a wrapper callback for all HTTP requests similar to how express does it so that when an 100ms long HTTP request comes in I can e.g. log 2 lines at beginning and end of request:
How to modify multiple outbound/external HTTP requests for NestJS
I have a NestJS app that acts as a central point for communicating with several different APIs. Each one will require different token authentication in the headers, so I want to have a custom HttpService for each one depending on which API I need to interact with.
How to inject a provider in NestJS from one module to another provider?
I am exporting TicketRepository
from TicketModule
which is then re-exported in ModelsModule
from @common/models
library. The TicketAccessGuard
has to have a TicketRepository
injected into it. I am using a factory patterns in the IncidentManagementModule
to create the TicketAccessGuard
because @common/models
library is accessible here. Then I export the TokenAccessGuard
. I import the IncidentManagementModule
into the app module and use the guard (app module is not allowed to import models module).
How to pass Query parameters into custom pipes in nestjs
I am trying to create two custom pipes ExcelToJsonPipe
and JsonValidationPipe
. First to transform the Excel file content into Json, and second is to validate that Json.