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

Silent error when injecatble requires itself #2481

Closed
lkostrowski opened this issue Jul 1, 2019 · 5 comments
Closed

Silent error when injecatble requires itself #2481

lkostrowski opened this issue Jul 1, 2019 · 5 comments
Labels
needs triage This issue has not been looked into type: question 🙌

Comments

@lkostrowski
Copy link

lkostrowski commented Jul 1, 2019

Bug Report

Current behavior

Nest allows injecting service to the same service (recursion happens?).

No errors are printed

Calling any endpoint returns Error: Couldn't connect to server

Input Code

  1. Start new nest app with default settings
  2. Open AppService
  3. Add constructor(private service: AppService) {} to AppService

Expected behavior

Nest console should throw error

Possible Solution

Nest console should throw error

Environment


Nest version: X.Y.Z
` "@nestjs/core": "^6.3.2",`
 
For Tooling issues:
- Node version: XX  `v10.15.3`
- Platform:  Mac

Others:

Is injecting service to itself valid operation?

@lkostrowski lkostrowski added the needs triage This issue has not been looked into label Jul 1, 2019
@kamilmysliwiec
Copy link
Member

Is injecting service to itself valid operation?

It's not, there is actually no reason to support this feature. What would you like to accomplish?

@kamilmysliwiec kamilmysliwiec added type: question 🙌 and removed needs triage This issue has not been looked into labels Jul 1, 2019
@lkostrowski
Copy link
Author

Nothing. I did this by mistake and was quite surprised how outcome looks like. When I figured out, I thought error should be thrown.
I asked question by-the-way, I propose to just disallow this operation (bug/request)

@kamilmysliwiec
Copy link
Member

Got it. Thanks for reporting! :) Fixed in 6.4.0

@lkostrowski
Copy link
Author

Cool, thanks!

@BrunnerLivio BrunnerLivio added the needs triage This issue has not been looked into label Aug 8, 2019
@lock
Copy link

lock bot commented Nov 6, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Nov 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs triage This issue has not been looked into type: question 🙌
Projects
None yet
Development

No branches or pull requests

3 participants