Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The register method of CacheModel does not utilize the useClass specified #306

Closed
2 of 4 tasks
mmuenker opened this issue Feb 8, 2024 · 1 comment
Closed
2 of 4 tasks
Labels
bug Something isn't working

Comments

@mmuenker
Copy link

mmuenker commented Feb 8, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

If the "register" method options include a "useClass" property, the class will not be utilized to determine the cache manager's options.

I am not sure if this is an issue in this repository or in the @nestjs/core repository.

Minimum reproduction code

https://github.com/mmuenker/cache-options-are-not-resolved

Steps to reproduce

  1. yarn
  2. yarn start

Expected behavior

During startup, the CacheModule.register function creates an instance of the CacheModuleOptionsLoader class, which is defined with useClass property.

Package version

2.2.1

NestJS version

10.3.2

Node.js version

18.18.2

In which operating systems have you tested?

  • macOS
  • Windows
  • Linux

Other

$ yarn start
[Nest] 665160  - 02/08/2024, 2:50:23 PM     LOG [NestFactory] Starting Nest application...
[Nest] 665160  - 02/08/2024, 2:50:23 PM     LOG [InstanceLoader] CacheModule dependencies initialized +8ms
[Nest] 665160  - 02/08/2024, 2:50:23 PM     LOG [InstanceLoader] AppModule dependencies initialized +0ms
[Nest] 665160  - 02/08/2024, 2:50:23 PM     LOG [RoutesResolver] AppController {/}: +4ms
[Nest] 665160  - 02/08/2024, 2:50:23 PM     LOG [RouterExplorer] Mapped {/, GET} route +1ms
[Nest] 665160  - 02/08/2024, 2:50:23 PM     LOG [NestApplication] Nest application successfully started +1ms
@mmuenker mmuenker added the bug Something isn't working label Feb 8, 2024
@kamilmysliwiec
Copy link
Member

Use registerAsync not register

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants