-
Notifications
You must be signed in to change notification settings - Fork 82
Open
Labels
help wantedExtra attention is neededExtra attention is needed
Description
I am using the forRootAsync
method to load roles dynamically from the database however I am getting an error. I am a newbie to Nestjs, so please let me know if I am doing something wrong
Error: Nest can't resolve dependencies of the __roles_builder__ (?). Please make sure that the argument at index [0] is available in the AccessControlModule context.
I am trying to to import the AccessControlModule
in the root module and I have a RolesService
to inject as a dependency in the forRootAsync
method. The code is below
AccessControlModule.forRootAsync({
inject: [{
provide: ROLE_REPO,
useClass: Role
}],
useFactory: (service: repo) => {
return new RolesBuilder([
...adminGrants // testing local file grants
]);
}
})
Metadata
Metadata
Assignees
Labels
help wantedExtra attention is neededExtra attention is needed