-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
After updating: Could not find a declaration file for module 'ws' #5202
Comments
## Description Update client dependencies, holding back socket.io-client to avoid socketio/socket.io#5202. Makes type tests target ~ version, to avoid duplicating previous package versions: `pnpm exec flub typetests -g client --exact "~2.3.0"`
## Description Update client dependencies, holding back socket.io-client to avoid socketio/socket.io#5202. Makes type tests target ~ version, to avoid duplicating previous package versions: `pnpm exec flub typetests -g client --exact "~2.3.0"`
This also happened to me when importing |
Before this change, the following error would be thrown when compiling with TypeScript: ``` node_modules/engine.io-client/build/esm/transports/websocket.node.d.ts:12:101 - error TS1340: Module 'ws' does not refer to a type, but is used as a type here. Did you mean 'typeof import('ws')'? 12 createSocket(uri: string, protocols: string | string[] | undefined, opts: Record<string, any>): import("ws"); ~~~~~~~~~~~~ ``` This behavior was introduced in [1], included in version `6.6.0`. The return type is forced as `any`, so that the `@types/ws` dependency is optional. [1]: f4d898e Related: #5202
This should be fixed by 175a2c5, included in |
Thank you , indeed I no longer see the error after doing those updates. |
This is not yet fixed in Using package.json |
Describe the bug
Probably related to #5201 but solution in there did not work in this case.
I just updated from
socket.io-client
v4.7.5 to v4.8.0 and I am now getting the following error during typescript compilation:Installing
@types/ws
results in a different error:Reverting back to 4.7.5 works fine again.
My project is TypeScript with
target: es2022
andmodule: preserve
options. I'm doingExpected behavior
Type declarations should be included and compilation should not error.
Platform:
The text was updated successfully, but these errors were encountered: