Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

types/ws Type 'Server' is not generic

Suddenly getting this error:

TypeScript: ./..\..\node_modules\@types\ws\index.d.ts:328:18
       Type 'Server' is not generic.


Angular CLI: 13.3.11
Node: 16.13.2
Package Manager: npm 8.1.2
OS: win32 x64

Angular: 13.4.0
... common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router, service-worker

Package Version
@angular-devkit/architect 0.1303.11
@angular-devkit/build-angular 13.3.11
@angular-devkit/core 13.3.11
@angular-devkit/schematics 13.3.11
@angular/cli 13.3.11
@angular/pwa 13.3.11
@schematics/angular 13.3.11
rxjs 6.6.7
typescript 5.1.3

Already tried to update @types/ws to version ^8.13.0 with no success

like image 705
JavierC Avatar asked Sep 13 '25 15:09

JavierC


2 Answers

I had the same issue npm i @types/[email protected] worked for me.

like image 58
Vincent Avatar answered Sep 15 '25 05:09

Vincent


I had a pretty old version of @types/node defined in my package.json which did not match my actual version of Node.js.

i removed that explicit dependency with npm uninstall @types/node (and let npm do the magic with an actual peer dependency).

like image 30
Lexor Avatar answered Sep 15 '25 05:09

Lexor