socketio / socketio/socket.io

Property 'of' does not exist on type 'Socket<DefaultEventsMap, DefaultEventsMap>'.

Open
#5,123 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

package:socket.io-client question
Dominant language
TypeScript
Stars
63.2k
Forks
10.3k
Avg merge
11d 20h
Merged PRs (30d)
2

Description

Describe the bug

i can't find the of property to defined a namespace
also cant find socket.to ... to send to specific room >.<

To Reproduce

Socket.IO client version: ^4.7.2

Client

import io from 'socket.io-client';

 const socket = io({
          transports: ['websocket'],
          autoConnect: true,
        })
       
socket.of....


Expected behavior
wanted to have autocomplete on all methods like in the docs .

Platform:

  • mac

Additional context
it s about typescript or idk I tried to install @types but same result ....

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the client Socket API used in the reproduction with the documentation for namespaces and rooms. Check whether of and to are server-side APIs or should be available on the client, then verify the expected TypeScript autocomplete behavior. Done means the supported API is correctly typed or the client/server distinction is documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.