Skip to content

[5.3.2] .d.ts references dom Request/Response #1270

Closed
@AviVahl

Description

@AviVahl

Bug report

new release changed the typings, and where it says Request/Response, it references global ones defined by dom.d.ts.

Actual Behavior

node_modules/webpack-dev-middleware/types/index.d.ts:168:21 - error TS2344: Type 'Request' does not satisfy the constraint 'IncomingMessage'.
  Type 'Request' is missing the following properties from type 'IncomingMessage': aborted, httpVersion, httpVersionMajor, httpVersionMinor, and 46 more.

168   headers?: Headers<Request, Response>;

Expected Behavior

It should pass type checking in strict typescript projects that don't specify skipLibCheck.

How Do We Reproduce?

mkdir dev-middleware-bug
cd dev-middleware-bug
npm init -y
npm i webpack webpack-dev-middleware typescript
npx tsc --init --skipLibCheck false
echo "import 'webpack-dev-middleware';" > a.ts
npx tsc --noEmit

Please paste the results of npx webpack-cli info here, and mention other relevant information

  System:
    OS: Linux 5.17 Fedora Linux 36 (Workstation Edition)
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz
    Memory: 56.48 GB / 62.43 GB
  Binaries:
    Node: 16.15.0 - ~/.nvm/versions/node/v16.15.0/bin/node
    Yarn: 1.22.18 - ~/.nvm/versions/node/v16.15.0/bin/yarn
    npm: 8.5.5 - ~/.nvm/versions/node/v16.15.0/bin/npm
  Browsers:
    Chrome: 101.0.4951.64
    Firefox: 100.0
  Packages:
    html-webpack-plugin: ^5.5.0 => 5.5.0 
    webpack: ^5.72.1 => 5.72.1 
    webpack-dev-middleware: ^5.3.2 => 5.3.2 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions