#Injecting a custom configuration through async load function

8 messages · Page 1 of 1 (latest)

crystal coral
#

I'm trying to do the same thing described in this Stackoverflow answer: https://stackoverflow.com/questions/69771141/nestjs-configmodule-forroot-asynchronuous

The problem is, that the application doesn't wait for "load" function to finish.

#

This is my config module

#

This is the dynamic module that imports either the ConfigModule with local environment path, or for production, uses the load function

#

This is the function that gets called by "load" function in ConfigModule

#

The problem is, that it doesn't wait for the load function to finish, so the config parameters are undefined when my JWT or TypeOrmModule gets loaded