NestJS · Senior · Question 4 of 75
A REQUEST-scoped provider is injected into a singleton service. What happens?
- ✓Correct answer: The service and its consumers become request-scoped too, so the whole chain is instantiated per request
- 2Nest throws an error at startup
- 3The singleton gets the first request's instance forever
Explanation
Scope bubbles up. In a busy app this can multiply allocations per request; durable providers or ALS are alternatives for multi-tenancy.