Definitelytyped: @types/express-serve-static-core error TS2430: Interface 'Request' incorrectly extends interface 'IncomingMessage'.

Created on 16 Jun 2017  Β·  6Comments  Β·  Source: DefinitelyTyped/DefinitelyTyped

Issue

When I execute the command tsc, I get the following error:

node_modules/@types/express-serve-static-core/index.d.ts(177,11): error TS2430: Interface 'Request' incorrectly extends interface 'IncomingMessage'.
  Types of property 'headers' are incompatible.
    Type '{ [key: string]: string | undefined; }' is not assignable to type '{ [key: string]: string | string[]; }'.
      Index signatures are incompatible.
        Type 'string | undefined' is not assignable to type 'string | string[]'.
          Type 'undefined' is not assignable to type 'string | string[]'.

The last time there were no such issues was 20 days ago, when the command tsc ran successfully.

Here is a snippet of my package.json file:

{
"devDependencies": {
    "@types/body-parser": "^1.16.3",
    "@types/chai": "^3.5.2",
    "@types/express": "^4.0.36",
    "@types/mocha": "^2.2.41",
    "chai": "^3.5.0",
    "concurrently": "^3.4.0",
    "mocha": "^3.4.1",
    "nodemon": "^1.11.0",
    "tslint": "^5.2.0",
    "typescript": "^2.3.2"
  },
"dependencies": {
    "@types/body-parser": "^1.16.3",
    "@types/node": "^7.0.31",
    "body-parser": "^1.17.2",
    "express": "^4.15.3"
  }
}

All 6 comments

Happened somewhere between these versions:

Fails

β”œβ”€β”€ @types/[email protected]
β”œβ”€β”€ @types/[email protected]
β”œβ”€β”€ @types/[email protected]
β”œβ”€β”€ @types/[email protected]
β”œβ”€β”¬ @types/[email protected]
β”‚ β”œβ”€β”€ @types/[email protected]
β”‚ └─┬ @types/[email protected]
β”‚   └── @types/[email protected]
β”œβ”€β”€ @types/[email protected]
β”œβ”€β”€ @types/[email protected]
β”œβ”€β”€ @types/[email protected]
β”œβ”€β”€ @types/[email protected]
β”œβ”€β”¬ @types/[email protected]
β”‚ └── @types/[email protected]
β”œβ”€β”€ @types/[email protected]

Works

β”œβ”€β”€ @types/[email protected] 
β”œβ”€β”€ @types/[email protected] 
β”œβ”€β”€ @types/[email protected] 
β”œβ”€β”€ @types/[email protected] 
β”œβ”€β”¬ @types/[email protected] 
β”‚ β”œβ”€β”€ @types/[email protected] 
β”‚ └─┬ @types/[email protected] 
β”‚   └── @types/[email protected] 
β”œβ”€β”€ @types/[email protected] 
β”œβ”€β”€ @types/[email protected] 
β”œβ”€β”€ @types/[email protected] 
β”œβ”€β”€ @types/[email protected] 
β”œβ”€β”¬ @types/[email protected] 
β”‚ └── @types/[email protected] 
└── @types/[email protected] 

Likely @types/[email protected] -> @types/[email protected]

Awesome! Works now! Thank you so much for the fix!

Cheers,
Suresh Gururajan

Could anyone please link to the fixing commit? @sureshgururajan

@sompylasar - Thank you for referencing it.

Was this page helpful?
0 / 5 - 0 ratings