Open azaelvaldo opened 4 months ago
I'm experiencing the same problem, did you figure out a fix?
I had to clone the module repo and remove the whole feature that implements terminus, then manually added the module to my project without npm, like an own module.
I faced the same issue.
If you are building an application using Webpack and do not require the health check feature, you can simply mock @nestjs/terminus in the bundle by updating your webpack.config.js file. This approach worked perfectly for me without any errors.
While the solution is not ideal, it serves as a temporary fix, and I hope a cleaner solution will be available in the future.
mock-terminus.js
module.exports = {
HealthCheckService: class {},
TerminusModule: class {},
HealthIndicator: class {},
};
webpack.config.js
{
...
plugins: [
...options.plugins,
new webpack.NormalModuleReplacementPlugin(
/@nestjs\/terminus/,
path.resolve(__dirname, 'mock-terminus.js'), // Replace @nestjs/terminus with mock
),
],
...
}
When I am building a bundled Webpack from my NestJS application, I get this error:
I am not using any feature from HealthCheck included by default in the module. Is it possible to create a module without the HealthCheck module that uses terminus?
Related error and not solved: https://github.com/nestjs/terminus/issues/1423