Skip to content

Type 'Http2ServerResponse' is not generic #28965

Closed
@davidlj95

Description

@davidlj95

Command

build

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

18.2.11

Description

The error in the title and below appears when trying to build an app using Angular v19

Seems that Http2ServerResponse type wasn't generic up until recently

I have @types/node@20.16.5 installed. Can't trace when it was introduced as couldn't find a CHANGELOG for @types/node

Minimal Reproduction

  1. Create an Angular v19 fresh app. With SSR.
  2. Remove skipLibCheck (that wasn't the default until recently)
  3. Install @types/node@20.16.5 as dependency
  4. Run ng build

Exception or Error

✘ [ERROR] TS2315: Type 'Http2ServerResponse' is not generic. [plugin angular-compiler]

    node_modules/.pnpm/@angular+ssr@19.0.1_3tltse6rekaa6pakct6mm2hr6a/node_modules/@angular/ssr/node/index.d.ts:190:100:
      190 │ ...rResponse | Http2ServerResponse<Http2ServerRequest>): Promise<...
          ╵                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Your Environment

_                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 19.0.1
Node: 22.11.0
Package Manager: pnpm 9.11.0
OS: darwin arm64

Angular: 19.0.0
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, platform-server
... router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1900.1
@angular-devkit/build-angular   19.0.1
@angular-devkit/core            19.0.1
@angular-devkit/schematics      19.0.1
@angular/cli                    19.0.1
@angular/ssr                    19.0.1
@schematics/angular             19.0.1
rxjs                            7.8.1
typescript                      5.6.3
zone.js                         0.15.0

Anything else relevant?

Upgrading to a recent version of @types/node where generic type is there fixes the issue

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions