You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The package web3-providers-ws uses "@types/ws": "^8.5.3". But a breaking change was introduced in @types/ws version 8.5.5. So, when the user adds the last version of web3.js, the version 8.5.5 is installed. And the following error comes:
Error: node_modules/@types/ws/index.d.ts:328:18 - error TS2315: Type 'Server' is not generic.
328 server?: HTTPServer<V>| HTTPSServer<V>| undefined;~~~~~~~~~~~~~
Error: node_modules/@types/ws/index.d.ts:328:34 - error TS2315: Type 'Server' is not generic.
328 server?: HTTPServer<V>| HTTPSServer<V>| undefined;~~~~~~~~~~~~~~
The package
web3-providers-ws
uses"@types/ws": "^8.5.3"
. But a breaking change was introduced in @types/ws version 8.5.5. So, when the user adds the last version of web3.js, the version 8.5.5 is installed. And the following error comes:For more check: DefinitelyTyped/DefinitelyTyped#65849 and
DefinitelyTyped/DefinitelyTyped#65501.
Suggested Solution
At the package
web3-providers-ws
, use"@types/ws": "8.5.3"
instead of"@types/ws": "^8.5.3"
and move it todevDependencies
.Quick Fix
At the project that uses web3.js, try Using the following at package.json:
The text was updated successfully, but these errors were encountered: