You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import{NestFactory}from'@nestjs/core';import{AppModule}from'./app.module';importLokiTransportfrom'winston-loki';asyncfunctionbootstrap(){constapp=awaitNestFactory.create(AppModule);app.enableShutdownHooks();// comment out the following statement and shutdown hooks will be awaitedconstlokiTransport=newLokiTransport({host: 'http://qweasd',});awaitapp.listen(3000);}bootstrap();
winston-loki uses async-exit-hook which overrides the default framework's behavior. This issue should be reported there (in the winston-loki repo) instead. There's nothing we can do on the NestJS side.
Is there an existing issue for this?
Current behavior
I use JaniAnttonen/winston-loki package.
After creating a transport, NestJS stops awaiting shutdown hooks.
app.enableShutdownHooks()
is enabled.See the reproduction code repo.
app.module.ts:
main.ts:
Only the first log appears.
Minimum reproduction code
https://github.com/andrew-sol/nestjs-reproduction-1
Steps to reproduce
yarn install --frozen-lockfile
ornpm install
yarn start:dev
ornpm run start:dev
Ctrl+C
Expected behavior
Both logs from the shutdown hook should be printed.
Package
@nestjs/common
@nestjs/core
@nestjs/microservices
@nestjs/platform-express
@nestjs/platform-fastify
@nestjs/platform-socket.io
@nestjs/platform-ws
@nestjs/testing
@nestjs/websockets
Other package
JaniAnttonen/winston-loki
NestJS version
8.4.5
Packages versions
@nestjs/cli@8.2.6
@nestjs/common@8.4.5
@nestjs/core@8.4.5
@nestjs/platform-express@8.4.5
@nestjs/schematics@8.0.11
@nestjs/testing@8.4.5
Node.js version
16.14.2
In which operating systems have you tested?
Other
No response
The text was updated successfully, but these errors were encountered: