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

Types in lib/Server referring to non-existing Request_1 and Response_1 interfaces #5054

Closed
cascornelissen opened this issue Feb 15, 2024 · 1 comment · Fixed by #5057
Closed

Comments

@cascornelissen
Copy link

cascornelissen commented Feb 15, 2024

Bug report

Actual Behavior

Types in webpack-dev-server/types/lib/Server.d.ts refer to non-existing Request_1 and Response_1 interfaces.

node_modules/webpack-dev-server/types/lib/Server.d.ts:1770:40 - error TS2552: Cannot find name 'Request_1'. Did you mean 'Request'?

1770   devMiddleware?: DevMiddlewareOptions<Request_1, Response_1> | undefined;
                                            ~~~~~~~~~

node_modules/webpack-dev-server/types/lib/Server.d.ts:1770:51 - error TS2552: Cannot find name 'Response_1'. Did you mean 'Response'?

1770   devMiddleware?: DevMiddlewareOptions<Request_1, Response_1> | undefined;

Expected Behavior

Types refer to existing interfaces.

How Do We Reproduce?

Import Configuration from webpack-dev-server (5.0.0 or 5.0.1) and look at the types of Configuration['devMiddleware']. I've prepared this Codesandbox that points directly to the offending type. For some reason the direct link doesn't consistently work for me so an alternative is to go to this link, which points to a different file in the same Codesandbox, and then right-click Configuration and select Go to Definition.

image

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

$ npx webpack-cli info

  System:
    OS: macOS 14.3
    CPU: (10) arm64 Apple M1 Max
    Memory: 905.86 MB / 64.00 GB
  Binaries:
    Node: 21.6.0 - /opt/homebrew/bin/node
    npm: 10.3.0 - /opt/homebrew/bin/npm
  Browsers:
    Chrome: 121.0.6167.160
    Firefox: 122.0.1
    Safari: 17.3
  Packages:
    babel-loader: ^9.1.3 => 9.1.3
    clean-webpack-plugin: ^4.0.0 => 4.0.0
    compression-webpack-plugin: ^11.0.0 => 11.0.0
    copy-webpack-plugin: ^12.0.2 => 12.0.2
    css-loader: ^6.10.0 => 6.10.0
    html-webpack-plugin: ^5.6.0 => 5.6.0
    html-webpack-skip-assets-plugin: ^1.0.3 => 1.0.3
    node-polyfill-webpack-plugin: ^3.0.0 => 3.0.0
    postcss-loader: ^8.1.0 => 8.1.0
    resolve-url-loader: ^5.0.0 => 5.0.0
    sass-loader: ^14.1.0 => 14.1.0
    style-loader: ^3.3.4 => 3.3.4
    terser-webpack-plugin: ^5.3.10 => 5.3.10
    ts-loader: ^9.5.1 => 9.5.1
    val-loader: ^6.0.0 => 6.0.0
    val-loader-modernizr: ^1.0.1 => 1.0.1
    warnings-to-errors-webpack-plugin: ^2.3.0 => 2.3.0
    webpack-cli: ^5.1.4 => 5.1.4
    webpack-dev-server: ^5.0.1 => 5.0.1
    webpack-merge: ^5.10.0 => 5.10.0
@cascornelissen cascornelissen changed the title Types of lib/Server referring to non-existing Request_1 and Response_1 interfaces Types in lib/Server referring to non-existing Request_1 and Response_1 interfaces Feb 15, 2024
@alexander-akait
Copy link
Member

Hm, that's intresting, sounds like a bug in ts...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants