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.29k stars 7.59k forks source link

No error output with ClientsModule.registerAsync when bufferLogs enabled #8275

Closed notmedia closed 3 years ago

notmedia commented 3 years ago

Is there an existing issue for this?

Current behavior

main.ts

  const app = await NestFactory.create(AppModule, {
    bufferLogs: true,
  });

module.ts

    ClientsModule.registerAsync([
      {
        name: 'TEST',
        inject: [ConfigService],
        useFactory: (config: ConfigService<Config>): ClientProvider => {
          return {
            transport: Transport.GRPC,
            options: {
              package: 'test',
              protoPath: join(__dirname, 'test.proto'),
            },
          };
        },
      },
    ]),

For example, don't install required @grpc/proto-loader. Btw the problem in async dynamic modules error handlers.

If you run this app, there is no output.

Expected behavior

Output exists

Package

NestJS version

8

Node.js version

16

In which operating systems have you tested?

jmcdo29 commented 3 years ago

Please provide a minimum reproduction repository. This will help us in reproducing the error and testing out solutions

notmedia commented 3 years ago

Sorry, I don't have enough time for creating a repo. I have already reported another bug for this project with repo and PR.. waiting since February. If you want, you can close this issue. I just report it for history.

jmcdo29 commented 3 years ago

I was able to find where the flush() call needs to be made. I'll have a PR up for it here soon. As for the PR in nestjs/graphql, I'm not aware enough of the context around it at the moment, but I'll try to take a look soon / get Kamil's attention back on it

jmcdo29 commented 3 years ago

Closing this so we can track the progress on #8278