You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The HttpHealthCheckStrategy uses the HttpHealthIndicator provided by the @nestjs/terminus package. When using the HttpHealthCheckStrategy as one of the application health checks, the server fails to start up and throws an error:
InvalidClassScopeException [Error]: HttpHealthIndicator is marked as a scoped provider. Request and transient-scoped providers can't be used in combination with "get()" method. Please, use "resolve()" instead.
This wasn't happening when I was using Vendure version 1.9.5, but is now happening when I'm on version 2.0.4.
First of all, we were using the injector.get(HttpHealthIndicator) method but NestJS requires the use of injector.resolve(HttpHealthIndicator) in this case. That was probably an API change that I didn't notice in one of the updates.
But resolving that issue exposed a deeper issue: due to internal changes in some earlier NestJS versions, the HttpHealthIndicator depends on the @nestjs/axios and axios packages being installed, and the HttpModule being imported into the core.
Since I don't really want to add 2 new dependencies for this single case (which is probably quite rarely used), I will create a custom health indicator which has no new dependencies for the next patch version.
Describe the bug
The
HttpHealthCheckStrategy
uses theHttpHealthIndicator
provided by the@nestjs/terminus
package. When using theHttpHealthCheckStrategy
as one of the application health checks, the server fails to start up and throws an error:This wasn't happening when I was using Vendure version 1.9.5, but is now happening when I'm on version 2.0.4.
To Reproduce
Steps to reproduce the behavior:
vendure-config.ts
file.Expected behavior
I expect the server to start up properly and the health check to be initialized.
Environment (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: