-
Notifications
You must be signed in to change notification settings - Fork 718
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing required @injectable annotation - but I'm pretty sure I have... #524
Comments
You need to decorate both the base and the derived class: The error:
Looks bad too me, Inversify should be able to tell you that the base class is missing the annotation. Will check out to see if there is something wrong with the error generation. |
Yup, that worked! I definitely agree, some mention of "hey, it's actually your abstract class that I don't know about" would be useful in this case. |
I though that was the way the error worked. I must check it out. Will leave this issue open until I find out. |
Closing this issue because I have created an issue that makes more clear how to reproduce the issue. |
I have a class that helps with bindings that is getting called here: https://github.com/atrauzzi/protoculture/blob/master/demo/console.ts#L10-L17
The parent method it's using is here, which is where I call inversify: Which you can see here: https://github.com/atrauzzi/protoculture/blob/master/src/ServiceProvider.ts#L34-L37
All of this is orchestrated by this toplevel class, which does an
import "reflect-metadata"
here: https://github.com/atrauzzi/protoculture/blob/master/src/Suite/Base.ts#L1But unfortunately, I still end up getting the following exception:
Which is terrible, because I'm fairly certain I've done everything necessary to flag it as injectable. It's worth noting that if I do the annotation (which I'm trying to avoid), I get an error about applying the same annotation twice. A bit mysterious...
The text was updated successfully, but these errors were encountered: