webSocketStartup logs "theWsServer.listen is not a function" — redundant .listen() call after constructor already starts the server
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 1/5
- Tiempo estimado
- Menos de una hora
- Aptitud para principiantes
- 85/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Tranquilo
- Stack tecnológico
- javascript, node.js
- Área
- backend, networking
Línea de trabajo
Abre appserver.js y localiza webSocketStartup; lee la construcción de websocket.Server y las llamadas de startup que aparecen a continuación. Elimina la llamada redundante a listen y verifica después que el startup ya no registre el mensaje not-a-function y que las conexiones WebSocket sigan funcionando.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- JavaScript
- Estrellas
- 7
- Forks
- 3
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Issues similares
-
code-quality refactoring
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
langchain-ai/deepagents#6450 ·
-
optimization optimization:agents-md-curator
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
githubnext/gh-aw-cao#13143 ·
-
status: needs triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100