Title: express.d.ts simple usage broken in latest bits · Issue #11875 · microsoft/TypeScript · GitHub
Open Graph Title: express.d.ts simple usage broken in latest bits · Issue #11875 · microsoft/TypeScript
X Title: express.d.ts simple usage broken in latest bits · Issue #11875 · microsoft/TypeScript
Description: A basic Express 4 sample has errors with the latest bits. It appears to be a regression in TypeScript 2.1. Below is how far I’ve managed to reduce the code into a standalone repro before heading home (from the definition currently in @ty...
Open Graph Description: A basic Express 4 sample has errors with the latest bits. It appears to be a regression in TypeScript 2.1. Below is how far I’ve managed to reduce the code into a standalone repro before heading ho...
X Description: A basic Express 4 sample has errors with the latest bits. It appears to be a regression in TypeScript 2.1. Below is how far I’ve managed to reduce the code into a standalone repro before heading ho...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/11875
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"express.d.ts simple usage broken in latest bits","articleBody":"A basic Express 4 sample has errors with the latest bits. It appears to be a regression in TypeScript 2.1.\n\nBelow is how far I’ve managed to reduce the code into a standalone repro before heading home (from the definition currently in @types/express).\n\nIf I compile with the current bits in the “release-2.0.5” branch there is no error. This is specific to what is currently in “release-2.1”.\n\n```\nseverity: 'Error'\nmessage: 'Argument of type '(err: any, req: Response, res: NextFunction, next: any) => void' is not assignable to parameter of type 'PathParams'.\n Type '(err: any, req: Response, res: NextFunction, next: any) => void' is not assignable to type '(string | RegExp)[]'.\n Property 'push' is missing in type '(err: any, req: Response, res: NextFunction, next: any) => void'.'\n```\n\n``` typescript\nvar app: myApp;\n\napp.use((err: any, req, res, next) => { return; }); // \u003c--- error on this call to 'use'\n\n\ninterface myApp {\n use: IRouterHandler\u003cthis> & IRouterMatcher\u003cthis>;\n}\n\n interface IRouterHandler\u003cT> {\n (...handlers: RequestHandler[]): T;\n (...handlers: RequestHandlerParams[]): T;\n }\n\n interface IRouterMatcher\u003cT> {\n (path: PathParams, ...handlers: RequestHandler[]): T;\n (path: PathParams, ...handlers: RequestHandlerParams[]): T;\n }\n\n type PathParams = string | RegExp | (string | RegExp)[];\n type RequestHandlerParams = RequestHandler | ErrorRequestHandler | (RequestHandler | ErrorRequestHandler)[];\n\n interface RequestHandler {\n (req: Request, res: Response, next: NextFunction): any;\n }\n\n interface ErrorRequestHandler {\n (err: any, req: Request, res: Response, next: NextFunction): any;\n }\n\n interface Request {\n method: string;\n }\n\n interface Response {\n statusCode: number;\n }\n\n interface NextFunction {\n (err?: any): void;\n }\n```\n","author":{"url":"https://github.com/billti","@type":"Person","name":"billti"},"datePublished":"2016-10-27T01:14:39Z","url":"https://github.com/microsoft/TypeScript/issues/11875"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:2b49ac5b-f9e3-a851-5d58-563274b92bbc |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D79E:2F543F:881FA7:B4B8DE:6B01B0F3 |
| html-safe-nonce | a43bbdabfdcfa3519ca2e3caec90c18e7c9b15dc7aa0a51f09b2c578c6b34e96 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENzlFOjJGNTQzRjo4ODFGQTc6QjRCOERFOjZCMDFCMEYzIiwidmlzaXRvcl9pZCI6IjExOTU5ODgxNjQ2NTg5MTU3MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 663967b342a871ab7f4652bd3470539f97d5a016c37d38bdffe72c303e46f4c7 |
| hovercard-subject-tag | issue:185550165 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/11875/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a849760f6ef5925fc1ca126b3fafeaace4b9d57d002251731234c8d40dcee91a/microsoft/TypeScript/issues/11875 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a849760f6ef5925fc1ca126b3fafeaace4b9d57d002251731234c8d40dcee91a/microsoft/TypeScript/issues/11875 |
| og:image:alt | A basic Express 4 sample has errors with the latest bits. It appears to be a regression in TypeScript 2.1. Below is how far I’ve managed to reduce the code into a standalone repro before heading ho... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | billti |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 20929025 |
| octolytics-dimension-repository_nwo | microsoft/TypeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20929025 |
| octolytics-dimension-repository_network_root_nwo | microsoft/TypeScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width