I am trying to use TSyringe for dependency injection, only problem is it doesn't work for my main class. All of my other autoinjectables work just fine, I just need to pass them to my
App
App
class. When I try to resolve it using
container.resolve(App)
container.resolve(App)
I get the following error:
474 | var paramInfo = typeInfo.get(ctor);475 | if (!paramInfo || paramInfo.length === 0) {476 | if (ctor.length === 0) {477 | return new ctor();478 | } else {479 | throw new Error('TypeInfo not known for "' + ctor.name + '"'); ^error: TypeInfo not known for "App"
474 | var paramInfo = typeInfo.get(ctor);475 | if (!paramInfo || paramInfo.length === 0) {476 | if (ctor.length === 0) {477 | return new ctor();478 | } else {479 | throw new Error('TypeInfo not known for "' + ctor.name + '"'); ^error: TypeInfo not known for "App"
After some debugging it seems to be failing to inject the dependencies into said class. If I remove everything from the constructor the error goes away. Literally any parameter specified in the constructor causes an error, even without any decorators above the class or the