Skip to content
Discussion options

You must be logged in to vote

@kasir-barati Ah, so I cloned your project and found the problem. You're missing the flag emitDecoratorMetadata in your shared library's tsconfig.json.

That means a built source of the CorrelationIdInterceptor doesn't contain any metadata that NestJS can read to inject dependencies, so it doesn't inject anything, and therefore stuff is undefined at runtime.

Once I added that flag and rebuilt the library, it works as intended. An alternative to enabling that flah is to explicitly decorate the constructor parameter with @Inject(ClsService).

Replies: 1 comment 18 replies

Comment options

You must be logged in to vote
18 replies
@kasir-barati
Comment options

@Papooch
Comment options

@kasir-barati
Comment options

@Papooch
Comment options

Answer selected by kasir-barati
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants