TypeError: io.of is not a function when using namespace in websocket gateway

オープン
#87 コメント 2 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
node.js, typescript
領域
backend

調査の方向性

The issue links to lib/index.ts at line 543, where io.of is called, and shows a NestJS @WebSocketGateway configured with a namespace. Start by reading that call and the surrounding instrumentation code, then check how the gateway passes its server when a namespace is set. Done means namespace configuration no longer triggers the reported TypeError, with the behavior covered by a test.

索引モデルが issue の本文から書いたものです。

説明

https://github.com/socketio/socket.io-admin-ui/blob/158864989dddeba67df9975a4cad48ef310f8c80/lib/index.ts#L543C32-L543C38

@WebSocketGateway(8080, {
namespace: 'chat',
cors: {
origin: '*',
credentials: true,
},
})

afterInit() {
instrument(this.server, {
auth: false,
mode: 'production',
});
}

// error TypeError: io.of is not a function

how to fix : remove namespace from @websocketgateway

// correct way

@WebSocketGateway(8080, {
cors: {
origin: '*',
credentials: true,
},
})

主要言語
Vue
スター
413
フォーク
109
PR マージ指標
30日以内にマージされた PR はありません

環境構築

  • Dockerfile または Docker Compose ファイルあり
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

socketio/socket.io-admin-ui のほかの issue

socketio/socket.io-admin-ui の issue をすべて見る

似ている issue

Backend & API Design の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。