needle-innovision / nestjs-tenancy

Multi-tenancy approach for nestjs - currently supported only for mongodb with mongoose
MIT License
186 stars 58 forks source link

Nest can't resolve dependencies of the TenancyCoreModule #19

Closed raikasdev closed 2 years ago

raikasdev commented 2 years ago

Hello! I am receiving this error while using the module. Source code for my project can be found here


services-messages-1  | 2022-05-18T18:24:09.078Z error: [ExceptionHandler] Nest can't resolve dependencies of the TenancyCoreModule (?). Please make sure that the argument ModuleRef at index [0] is available in the TenancyCoreModule context.
services-messages-1  | 
services-messages-1  | Potential solutions:
services-messages-1  | - If ModuleRef is a provider, is it part of the current TenancyCoreModule?
services-messages-1  | - If ModuleRef is exported from a separate @Module, is that module imported within TenancyCoreModule?
services-messages-1  |   @Module({
services-messages-1  |     imports: [ /* the Module containing ModuleRef */ ]
services-messages-1  |   })
services-messages-1  | ```
sandeepsuvit commented 2 years ago

Hi @raikasdev i assume the code that you have provided is inclined more towards microservice messaging protocol and also the controllers are getting invoked that way. This library doesn't support microservice based communication yet. Mostly this works on the REST api's as the tenant context is resolved via REQUEST_SCOPE