Skip to content

nodejs unit-http misses close()? #1061

Open
@kbzowski

Description

@kbzowski

I have notice that during shutdown of NestJS based application which uses express internally I got an error:

TypeError: this.httpServer.close is not a function
   at /app/server/node_modules/@nestjs/platform-express/adapters/express-adapter.js:96:55
   at new Promise .new Promise (<anonymous> undefined)
   at ExpressAdapter.close (/app/server/node_modules/@nestjs/platform-express/adapters/express-adapter.js:96:16 undefined)   
   at NestApplication.dispose (/app/server/node_modules/@nestjs/core/nest-application.js:47:53 undefined)
   at async process.cleanup (/app/server/node_modules/@nestjs/core/nest-application-context.js:189:1

Origin of the error is the close() function https://github.com/nestjs/nest/blob/master/packages/platform-express/adapters/express-adapter.ts#L160 which calls http.close(). As far as I can see unit does not implement this function. Correct me please if I don't understand something.

Metadata

Metadata

Labels

z-node-jsLanguage-Module for JavaScript (Node.js)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions