webSocketStartup logs "theWsServer.listen is not a function" — redundant .listen() call after constructor already starts the server
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 1/5
- Tempo stimato
- Meno di un'ora
- Idoneità per principianti
- 85/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Tranquilla
- Stack tecnologico
- javascript, node.js
- Ambito
- backend, networking
Direzione di ricerca
Apri appserver.js e individua webSocketStartup; leggi la costruzione di websocket.Server e le chiamate di avvio successive. Rimuovi la chiamata ridondante a listen, quindi verifica che l'avvio non registri più il messaggio not-a-function e che le connessioni WebSocket continuino a funzionare.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
When installing a test instance of rss.chat, Claude Code flagged an websockets error that turned out to not be an error. Here is Claude's bug report.
In appserver.js v0.8.3, the webSocketStartup function (rewritten 5/25/25) calls theWsServer.listen() after constructing the server with a port option:
theWsServer = new websocket.Server({port: config.websocketPort}); //5/25/25 by DW
theWsServer.on ("connection", handleWebSocketConnection); //5/25/25 by DW
console.log ("webSocketStartup: config.websocketPort == " + config.websocketPort);
theWsServer.listen (config.websocketPort); // ← throws
ws.Server has never exposed a public .listen() method. When you pass port to the constructor, the library creates an internal net.Server and calls .listen() on it automatically — the socket is already bound and ready before that last line runs. The call throws, the catch logs "webSocketStartup: err.message == theWsServer.listen is not a function", and the function returns.
The server is not broken — port binding and the connection handler are both set up before the throw, so WebSocket connections work normally. But the logged message looks like a fatal startup failure and will alarm anyone reading the logs.
Fix: remove the redundant .listen() call.
function webSocketStartup () {
if (config.flWebsocketEnabled) {
try {
theWsServer = new websocket.Server({port: config.websocketPort});
theWsServer.on ("connection", handleWebSocketConnection);
console.log ("webSocketStartup: listening on port " + config.websocketPort);
}
catch (err) {
console.log ("webSocketStartup: err.message == " + err.message);
}
Environment: daveappserver 0.8.3, ws 8.21.1, Node v24.18.0.
- Lingua principale
- JavaScript
- Stelle
- 7
- Fork
- 3
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
avniproject/avni-client#2135 ·
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
babalae/bettergi-scripts-list#3674 ·
-
A-Release-Notes C-Editing D-Modest S-Ready-For-Implementation
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
bevyengine/bevy-website#2595 ·
-
ecosystem wording
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
matrix-org/matrix.org#3649 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
vadimdemedes/ink#1029 ·