Relative Content

Tag Archive for dependency-injectionnestjs

Import nest-mqtt inside Nest.js

I want to create an MQTT conection based on Configuration module in my Nest.js app. I am using very old npm package: https://github.com/microud/nest-mqtt . I updated necessary dependencies and now I try to use it. However i am experiencing this issue:

Right way to inject dependencies in NestJS

I’m new to NestJS and also unfamiliar with DI. I’m building a simple API with NestJS. Everything is fine when each module have only 1 DB connect dependency. But when I inject a service to another service . Like this