-
Notifications
You must be signed in to change notification settings - Fork 53
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
Dependency injection doesn't work as expected #32
Comments
I'm facing exactly the same issue |
I think this not work with scope request |
Found in this example to inject the dependency using |
Actually forgot the |
any solution for this problem ? |
I got the same issue. Can anyone help? |
regarding above implementation
SqsMessageHandler have dificulty in taking dynamic name as above, please refer to my solution below |
@SK-CSE I am using this implementation but getting "Object is possibly undefined" error, although I tried giving it some default value as well. Any workaround for this? |
It seems that the method decorated with
@SqsMessageHandler()
gets called just as plain function, ignoring the class it is defined in and its initialisation steps. My setup is following:scheduled-jobs.handler.ts
app.module.ts
When the message is received in the debugger I can see that
this.logger
andthis.createInvoicesJob
and evenconstants
are all undefined. Seems like the file itself is not executed, only the decorated function. Is this expected behaviour?The text was updated successfully, but these errors were encountered: