nestjs / nest

A progressive Node.js framework for building efficient, scalable, and enterprise-grade server-side applications with TypeScript/JavaScript 🚀
https://nestjs.com
MIT License
67.69k stars 7.63k forks source link

If HttpAdapterHost is a provider, is it part of the current ClsModule? #13581

Closed Nijinsha closed 6 months ago

Nijinsha commented 6 months ago

Is there an existing issue for this?

Current behavior

 ERROR [ExceptionHandler] Nest can't resolve dependencies of the ClsModule (?, ModuleRef). Please make sure that the argument HttpAdapterHost at index [0] is available in the ClsModule context.

Potential solutions:
- Is ClsModule a valid NestJS module?
- If HttpAdapterHost is a provider, is it part of the current ClsModule?
- If HttpAdapterHost is exported from a separate @Module, is that module imported within ClsModule?
  @Module({
    imports: [ /* the Module containing HttpAdapterHost */ ]
  })

Minimum reproduction code

https://github.com/nestjs/nest/i

Steps to reproduce

No response

Expected behavior

ClsModule should work

Package

Other package

nestjs-cls

NestJS version

10.0.0

Packages versions

    "@nestjs/common": "~10.0.0",
    "@nestjs/core": "^10.0.0",
    "nestjs-cls": "~4.2.1",
    "@nestjs/platform-express": "^10.0.0",
    "reflect-metadata": "^0.1.13",
    "rxjs": "^7.8.1",
    "typeorm": "~0.3.20",
    "@nestjs/config": "~3.2.2",
    "@nestjs/typeorm": "~10.0.2",
    "@nestjs/event-emitter": "~2.0.4",
    "@nestjs/swagger": "~7.3.1",
    "pg": "~8.11.3"

Node.js version

20.12.0

In which operating systems have you tested?

Other

No response

micalevisk commented 6 months ago

please read the https://docs.nestjs.com/faq/common-errors page

If you think that this is a bug, share us a minimum reproduction repository.