Skip to content
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 not working in Class decorated with @SqsMessageHandler #36

Open
bryanmaraujo544 opened this issue Dec 10, 2022 · 7 comments

Comments

@bryanmaraujo544
Copy link

No description provided.

@LaurentRos
Copy link

Found in this example to inject the dependency using @Inject(forwardRef(() => Service)). Seems to do the job, not sure why we need that though...

@LaurentRos
Copy link

LaurentRos commented Feb 10, 2023

Actually forgot the @Injectable() on the Handler in my case, seems to be working fine now!

@bryanmaraujo544
Copy link
Author

bryanmaraujo544 commented Apr 11, 2023

Even with this approach did not work to me :(. Which version of Nest are you using? @LaurentRos

@LaurentRos
Copy link

Sorry for the late reply, I'm using @nestjs/common: 9.4.0 !

@krisnadiputra
Copy link

I am having the same problem using @nestjs/common: 10.0.0 and @ssut/nestjs-sqs: 2.2.0

@ruscon
Copy link

ruscon commented Dec 14, 2023

Works ok for me

"@nestjs/common": "^10.2.10",
"@ssut/nestjs-sqs": "^2.2.0",

@krisnadiputra
Copy link

It turns out the scope in @Injectable({ scope: Scope.REQUEST }) is the culprit in my case. It works after I remove it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants