NestJS · Senior · Question 10 of 75

Why might an injected value be undefined inside a constructor but defined later, with circular dependencies?

Explanation

Avoid doing work in constructors that depends on other providers' state.

Further reading

Problem with a question

NestJS · Senior · question 10

Test yourself

Take the NestJS · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz