Skip to content

registerAsync is not passing imports array  #1

Description

@cojack

As in topic, because of this I'm not able to create an app:

        QueueModule.registerAsync({
            isGlobal: true,
            useClass: AppQueueService,
            imports: []
        }),

It returns me an error:

[Nest] 26166   - 01/12/2021, 1:25:20 PM   [ExceptionHandler] Nest can't resolve dependencies of the __QUEUE_OPTIONS__ (?). Please make sure that the argument AppQueueService at index [0] is available in the QueueModule context.

Potential solutions:                                                                                                                                                                                                                                                                                                       
- If AppQueueService is a provider, is it part of the current QueueModule?                                                                                                                                                                                                                                                 
- If AppQueueService is exported from a separate @Module, is that module imported within QueueModule?                                                                                                                                                                                                                      
  @Module({
    imports: [ /* the Module containing AppQueueService */ ]
  })
 +0ms

Where class looks like this:

@Injectable()
export class AppQueueService implements QueueAsyncOptionsFactory {
    constructor(
        @Inject(awsConfig.KEY)
        private readonly configAws: ConfigType<typeof awsConfig>
    ) {}
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions