-
Notifications
You must be signed in to change notification settings - Fork 353
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
According to Socket IO's documentation, query
option could be a number as well and with JavaScript, it works as it expected. However there are Type errors with Typescript
To Reproduce
Client
// my-file.ts (Example from docs)
import { io } from "socket.io-client";
const socket = io({
query: {
x: 42
}
});
Expected behavior
No Type errors.
Received Errror
No overload matches this call.
Overload 1 of 3, '(uri: string, opts?: Partial<ManagerOptions & SocketOptions>): Socket<DefaultEventsMap, DefaultEventsMap>', gave the following error.
Type 'number' is not assignable to type 'string'.
Overload 2 of 3, '(uri: string | Partial<ManagerOptions & SocketOptions>, opts?: Partial<ManagerOptions & SocketOptions>): Socket<...>', gave the following error.
Type 'number' is not assignable to type 'string'.ts(2769)
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working