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

custom-server-express fix type definition and eliminate dead code #37054

Merged
merged 2 commits into from
May 22, 2022

Conversation

dearlordylord
Copy link
Contributor

@dearlordylord dearlordylord commented May 20, 2022

Hi, this signature confused me a bit when I was porting it in typescript. Turns out there's dead code: there's no Error object passed to this function. Details of this signature are in this answer: https://stackoverflow.com/a/56291567/2123547, and in @types/express-server-static-core it is listen(port: number, callback?: () => void): http.Server;. Types definitions: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/express-serve-static-core/index.d.ts#L1198

fixes #37053

Bug

  • [x ] Related issues linked using fixes #number
  • Integration tests added
  • Errors have helpful link attached, see contributing.md

Feature

  • Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
  • Related issues linked using fixes #number
  • Integration tests added
  • Documentation added
  • Telemetry added. In case of a feature if it's used or not.
  • Errors have helpful link attached, see contributing.md

Documentation / Examples

  • [ x] Make sure the linting passes by running yarn lint

@ijjk ijjk added the examples Issue/PR related to examples label May 20, 2022
Copy link
Member

@ijjk ijjk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

@kodiakhq kodiakhq bot merged commit 87e93a2 into vercel:canary May 22, 2022
@dearlordylord dearlordylord deleted the patch-2 branch May 22, 2022 03:36
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
examples Issue/PR related to examples
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect .listen callback definition in custom-server-express/server.js example
2 participants