I am getting an error from maybeCloseWebSocketSource api.getInternalData(elt) does not have websocket property and web socket already closed by htmx:beforeCleanupElement event
possibly something I am doing wrong however if I change it to:
function maybeCloseWebSocketSource(elt) {
if (!api.bodyContains(elt)) {
console.log('maybe closing web socket')
const internalData = api.getInternalData(elt)
if (internalData.webSocket) {
internalData.webSocket.close();
return true;
}
return false;
}
return false;
}
I also get Uncaught TypeError: api.getInternalData(...).webSocket is undefined when making an htmx request that replaces the existing section of the document that has the ws-connect attribute on it.
I am getting an error from maybeCloseWebSocketSource api.getInternalData(elt) does not have websocket property and web socket already closed by htmx:beforeCleanupElement event
it goes away..