When calling a method from a class using the @Inject decorator I get the error bellow. It's not very informative and I couldn't find a similar error that matched my case.
TypeError: Invalid type requested to IoC container. Type is not defined.
Possible Solution
Maybe a configuration or package/package version that I'm missing?
Hi, I have a very simple project setup, with Nx as mono repo solution and a barebones Express app.
The app has 1 controller and 1 service, I tried following Tsoa's official guide on how to implement typescript-ioc: https://tsoa-community.github.io/docs/di.html#typescript-ioc
Even though the routes and app are being built, and the app is being served correctly, I get an error when calling methods from an injected class.
Sorting
I'm submitting a ...
I confirm that I
Expected Behavior
I should be able to call methods from a class using the
@Inject
decorator.My base tsconfig.ts file has the decorator properties set.
Current Behavior
When calling a method from a class using the
@Inject
decorator I get the error bellow. It's not very informative and I couldn't find a similar error that matched my case.Possible Solution
Maybe a configuration or package/package version that I'm missing?
Steps to Reproduce
http://localhost:3000/docs/
users/{userId}
endpoint, open It and try any number as the Id to call the service.Context (Environment)
Version of the library:
Version of NodeJS: v18.19.0