-
Notifications
You must be signed in to change notification settings - Fork 394
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
fix: TypeDI do not inject service #1241
Comments
Did you import reflect-metadata? |
same problem. It's ok in development mode, but crashed in production mode. |
my package.json |
You can see an example of hexagonal architecture with typedi for inject dependences https://github.com/luisalbertodev/ddd-typescript-hexagonal-architecture |
TypeDI was not able to inject sercie container in controller
Here is my code
i've tried all method written in documentation but still get error
Expected behavior
it should inject the dependencies and return json
Actual behavior
TypeError: this.test.getName is not a function
at BaseController.index (file:///E:/private/noidejs/nodets-pack/src/controllers/collection/base.controller.ts:14:28)
at ActionMetadata.callMethod (E:\private\noidejs\nodets-pack\node_modules.pnpm@[email protected][email protected][email protected]\node_modules@enjoys\main\metadata\ActionMetadata.ts:252:44)
at E:\private\noidejs\nodets-pack\node_modules.pnpm@[email protected][email protected][email protected]\node_modules@enjoys\main\RoutingControllers.ts:123:28
at processTicksAndRejections (node:internal/process/task_queues:95:5)
The text was updated successfully, but these errors were encountered: