Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect Type for NestExpressAdapter #11279

Closed
3 of 15 tasks
bmeverett opened this issue Mar 14, 2023 · 1 comment · Fixed by #11280
Closed
3 of 15 tasks

Incorrect Type for NestExpressAdapter #11279

bmeverett opened this issue Mar 14, 2023 · 1 comment · Fixed by #11280
Labels
needs triage This issue has not been looked into

Comments

@bmeverett
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

Type error on server.keepAliveTimeout. This was previously working on older versions and seems to have broken when the interface was typed in d6a89fa

Minimum reproduction code

https://github.com/bmeverett/nest-keep-alive

Steps to reproduce

Create a new NestJS application.
In main.ts assign the app.listen call to a variable

When updating to NestJS 9.2.x and above the keepAliveTimeout is no longer able to be used on the response of app.listen()

 const app = await NestFactory.create<NestExpressApplication>(AppModule);
  const server = await app.listen(3000);
  server.keepAliveTimeout = 30_000

Expected behavior

I believe the type should be http.Server (it inherits from the generic Server)

Express
Http Server

Package

  • I don't know. Or some 3rd-party 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 (see below)

Other package

No response

NestJS version

9.3

Packages versions

platform-express version : 9.3.9
schematics version       : 9.0.4
testing version          : 9.3.9
common version           : 9.3.9
core version             : 9.3.9
cli version              : 9.2.0

Node.js version

18.7

In which operating systems have you tested?

  • macOS
  • Windows
  • Linux

Other

No response

@micalevisk
Copy link
Member

micalevisk commented Mar 14, 2023

thanks for reporting! Let's track this here: #11280

I don't recall exactly why I chose net instead of http in there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage This issue has not been looked into
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants