import { EntityTarget, Repository } from "typeorm"
import { injectable, unmanaged, inject } from "inversify";
@injectable()
export abstract class RepositoryBase<T extends EntityBase> implements IRepository<T> {
protected _repository: Repository<T>;
protected _db: Database;
constructor(@unmanaged() entity: EntityTarget<T>, db: Database) {
this._db = db;
this._repository = this._db.getRepository(entity);
}
Build error:
Data/Repositories/RepositoryBase.ts:11:18 - error TS1239: Unable to resolve signature of parameter decorator when called as an expression.
Argument of type 'undefined' is not assignable to parameter of type 'string'.
11 constructor(@unmanaged() entity: EntityTarget<T>, db: Database) {
~~~~~~~~~~~
Found 1 error in Data/Repositories/RepositoryBase.ts:11
The issue is fixed.
You can simply update to inversify v6.0.2 and up (if exists)