Closed dmitrye closed 1 year ago
what's the update on this
@ogheneovo12 fixed v1.9, pls try it out and let me know how it works, thanks
So I tried it out and still encountered same errors,
src/app.module.ts:43:27 - error TS2345: Argument of type 'typeof RbacService' is not assignable to parameter of type 'new () => IDynamicStorageRbac'.
Types of construct signatures are incompatible.
Type 'new (roleRepository: Model<RoleDocument, {}, {}, {}, any>, permissionRepository: Model<PermisionDocument, {}, {}, {}, any>) => RbacService' is not assignable to type 'new () => IDynamicStorageRbac'.
43 RBAcModule.forDynamic(RbacService),
~~~~~~~~~~~
[7:15:13 AM] Found 1 error. Watching for file changes.
created a fork of the repo, and updated the forDynamic Typings here in #84
installed my fork of the repo with typing fix, the typing error was gone, then a similar issue in #80 came up again
[Nest] 19527 - 05/02/2023, 7:26:26 AM ERROR [ExceptionHandler] Nest can't resolve dependencies of the RBAcModule (?). Please make sure that the argument ModuleRef at index [0] is available in the RBAcModule context.
looking to see if i can find a fix
Hi @ogheneovo12, could you provide a test repo this issue?
just tested again and the error is gone
fixed in v1.9.1
Getting the same issue as https://github.com/sergey-telpuk/nestjs-rbac/issues/70.
NestJS: 9.4.0 Typescript: 4.9.5 nestjs-rbac: 1.8.4 TypeORM: 9.0.1
I even tested the exact example from the README and it also fails with the same errors. TypeScript is what's generating the error because the underlying signature does not support parameters in the constructor.
It's therefore a bug since you're documenting it as a supported feature.