#ConfigurableModuleClass static register method does not accept imports, inject, useFactory etc.
10 messages · Page 1 of 1 (latest)
Are you meaning how when using the ConfigurableModuleBuilder the resulting module's register (or forRoot) method doesn't allow you to inject or imports with an async module declaration object?
@storm plank yes correct
Well, because that's how we view that dynamic modules should be written. The non-async method should be a direct passing of the value you need. The async value should be able to be either async (via useFactory) or it should require DI and another provider (like the ConfigService) to be setup properly
Okay. Makes sense. Would be great if this would have been added as a clarification in the docs. (The docs are an absolute gem btw💎)
Plus, this is how all of the dynamic modules in the docs are shown in the first place 🙂
You mean this part right ? https://docs.nestjs.com/fundamentals/dynamic-modules#community-guidelines:~:text=that mean the same thing%2C but use Nest's Dependency Injection for the configuration as well.
Nest is a framework for building efficient, scalable Node.js server-side applications. It uses progressive JavaScript, is built with TypeScript and combines elements of OOP (Object Oriented Progamming), FP (Functional Programming), and FRP (Functional Reactive Programming).
Yep
Yes, but just mentioning it would be a bit helpful for newbs like me😅