-
-
Notifications
You must be signed in to change notification settings - Fork 8k
Closed
Labels
effort2: dayspriority: medium (3)Medium priority issue that needs to be resolvedMedium priority issue that needs to be resolvedscope: coretype: potential issue 💔
Description
Bug Report
Current behavior
The issue arises in the following setup:
AppModule
imports ModuleA
(global) and ModuleB
(non-global) and ConfigModule.forRoot
,
ModuleA
declares some REQUEST
-scoped provider X
with request context being injected,
ModuleB
imports ConfigModule.forFeature
, and declares some provider Y
, without specifying a scope, with X
and config being injected.
In such setup constructor for X
injected into Y
is not called (in case X
is declared using class).
If X
is declared via useFactory
, null
is injected into Y
.
Input Code
https://github.com/zyulyaev/nest-global-module-issue
Expected behavior
X
's constructor is called and its dependencies are injected.
Environment
Nest version: 7.1.2
For Tooling issues:
- Node version: v12.15.0
- Platform: macos
Others:
package manager: pnpm
micalevisk, thenglong and tajnymagRodolpheGohard, micalevisk and tajnymag
Metadata
Metadata
Assignees
Labels
effort2: dayspriority: medium (3)Medium priority issue that needs to be resolvedMedium priority issue that needs to be resolvedscope: coretype: potential issue 💔