#Dynamic Module can't use ConfigurableModuleBuilder MODULE_OPTIONS_TOKEN

3 messages · Page 1 of 1 (latest)

loud jasper
#

I cant do like this

@Module({
  imports: [
    RedisModule.forRootAsync({
      inject: [MODULE_OPTIONS_TOKEN],
      useFactory: async (options: ICacheModuleOptions) => ({
        config: {
          host: options.host,
          port: options.port
        },
      }),
    }),
  ],
})
export class CacheModule extends ConfigurableModuleClass {}

and getting an error

Nest can't resolve dependencies of the Symbol() (?). Please make sure that the argument "CONFIGURABLE_MODULE_OPTIONS[4dfb49aef07f49aba685f]" at index [0] is available in the SomeModule context

There is an closed issue which I found https://github.com/nestjs/nest/issues/12910 but advise here didnt helped to resolve it
Also there is a code for deproduce

GitHub

Is there an existing issue for this? I have searched the existing issues Current behavior Nest can't resolve dependencies of the Symbol() (?). Please make sure that the argument "CONFIGURA...

fiery arrow
buoyant cedar