WebSockets: Uncaught (in response) Error: The script will never generate a response.
I have a very simple function that listens for WebSocket connections and sends the current time whenever a message is received:
The script is working fine but every time the WebSocket is closed by the client, the following error is logged:
The only information I've seen about this error has to do with either Promises or external libraries, neither of which I am using so I am confused as to what is causing this error message.
1 Reply
I figured it out, the issue is that there that the WebSocket is never properly closed, meaning that the function reaches a state where it can never be resolved. Adding a listener like this fixes it: