denoland / deno

A modern runtime for JavaScript and TypeScript.
https://deno.com
MIT License
97.68k stars 5.38k forks source link

NestJS cannot resolve ModuleRef dependency after TerminusModule is added #26427

Open lucassusanto opened 3 weeks ago

lucassusanto commented 3 weeks ago

Problem

How To Reproduce

  1. Clone the minimal reproducible project example
    git clone https://github.com/lucassusanto/nestjs-deno-terminus-issue
  2. Install the dependencies
    deno install
  3. Run the application
    deno run --allow-env --allow-net --allow-read src/main.ts
  4. NestJS won't start

    [Nest] 13408  - 10/20/2024, 3:06:53 PM   ERROR [ExceptionHandler] Nest can't resolve dependencies of the TypeOrmHealthIndicator (?). Please make sure that the argument ModuleRef at index [0] is available in the TerminusModule context.
    
    Potential solutions:
    - Is TerminusModule a valid NestJS module?
    - If ModuleRef is a provider, is it part of the current TerminusModule?
    - If ModuleRef is exported from a separate @Module, is that module imported within TerminusModule?
     @Module({
       imports: [ /* the Module containing ModuleRef */ ]
     })

Expected Result

Additional Context

lucassusanto commented 3 weeks ago

It also happens while I'm using pure deno—not node compat. Here is the minimal reproducible project: https://github.com/lucassusanto/nestjs-deno-terminus-issue/tree/deno-starter