#ConfigModule instantiated twice launching app

2 messages · Page 1 of 1 (latest)

honest fractal
#

When I launch the app my ConfigModule is instantiated twice also the ConfigHostModule which is never declared in my project I expect nestjs to import the module once and use it in the whole app you can check the code, the behavior and details here -> https://stackoverflow.com/questions/77149064/default-configmodule-instantiated-twice

wheat cedar
#

I saw your response to my question, that there's only config module in the app module. Nest would then only be creating it once, if I recall.. However, even if it is being "instructed" twice here, it's not a true instantiation. It's really that nest is reading the module is needed in two places and creating it once while reusing it the other time if appropriate