Decorate external lib where the class has Super
The solution provided there doesn't work in this case, a solution is proposed but don't work
import { decorate, injectable } from 'inversify' decorate(injectable(), SomeClass)
This approach doesn't work if the class has a super. You could get the super in the following way:
const mySuper = Object.getPrototypeOf(SomeClass).constructor; decorate(injectable(), mySuper)
But this didn't work, I believe it is because in runtime you don't have the name of the Super, so it couldn't find it, but curious enough the error of InversifyJS tells me the error with the parent className, for some reason it didn't realize that is the parent
The error that inversifyJS throw is:
Uncaught Error: Missing required @injectable annotation in: SuperClassName.
Solution: const mySuper = Object.getPrototypeOf(SomeClass).constructor.__proto__; or const mySuper = SomeClass.constructor.__proto__;
decorate(injectable(), SomeClass) decorate(injectable(), mySuper)
Hey @titusfx, you can decorate the base class and then decorate the class and that should solve your issue.
Having said that, inversify has a variety of bindings, you could probably bind you service toConstantValue manually building your instance, not the best practice but it could be a workaround.