-
Notifications
You must be signed in to change notification settings - Fork 31
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
@nestjs/terminus module cannot be bundled #285
Comments
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:
ERROR in ./node_modules/@nestjs/terminus/dist/utils/checkPackage.util.js.map 1:10
Module parse failed: Unexpected token (1:10)
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: nestjs/terminus#1423
The text was updated successfully, but these errors were encountered: