You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description:
When the LM Studio WebSocket connection fails (e.g., when trying to connect to an unavailable server), an uncaught ReferenceError is thrown due to an undefined 'event' variable in the error handler.
Steps to Reproduce:
Initialize LMStudioClient with an unavailable WebSocket endpoint
The connection attempt fails
The SDK attempts to handle the error but crashes
Error Stack Trace:
backend-1 | [2024-12-11T12:44:12.675Z] WARN: LMStudioClient Warning: [LMStudioClient][LLM][ClientPort][WsClientTransport:AuthenticatedWsClientTransport] WebSocket error: connect ECONNREFUSED 192.168.65.254:1234
backend-1 | Stack Trace:
backend-1 | Error: connect ECONNREFUSED 192.168.65.254:1234
backend-1 | at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1278:16)
backend-1 | [2024-12-11T12:44:12.677Z] WARN: LMStudioClient Warning: [LMStudioClient][LLM][ClientPort][WsClientTransport:AuthenticatedWsClientTransport] WebSocket connection refused. This can happen if the server is not running or the client is trying to connect to the wrong path. The server path that this client is attempting to connect to is: ws://host.docker.internal:1234/llm.
backend-1 |
backend-1 | Please make sure the following:
backend-1 |
backend-1 | 1. LM Studio is running
backend-1 |
backend-1 | 2. The API server in LM Studio has started
backend-1 |
backend-1 | 3. The client is attempting to connect to the correct path
backend-1 | /app/node_modules/@lmstudio/sdk/dist/index.cjs:9840
backend-1 | this.errored(event);
backend-1 | ^
backend-1 |
backend-1 | ReferenceError: event is not defined
backend-1 | at AuthenticatedWsClientTransport.onWsError (/app/node_modules/@lmstudio/sdk/dist/index.cjs:9840:22)
backend-1 | at WebSocket. (/app/node_modules/@lmstudio/sdk/dist/index.cjs:9768:61)
backend-1 | at callListener (/app/node_modules/ws/lib/event-target.js:290:14)
backend-1 | at WebSocket.onError (/app/node_modules/ws/lib/event-target.js:230:9)
backend-1 | at WebSocket.emit (node:events:513:28)
backend-1 | at emitErrorAndClose (/app/node_modules/ws/lib/websocket.js:1041:13)
backend-1 | at ClientRequest. (/app/node_modules/ws/lib/websocket.js:881:5)
backend-1 | at ClientRequest.emit (node:events:513:28)
backend-1 | at Socket.socketErrorListener (node:_http_client:494:9)
backend-1 | at Socket.emit (node:events:513:28)
Expected Behavior:
The WebSocket connection failure should be handled gracefully, allowing the application to catch and handle the connection error.
Actual Behavior:
The SDK throws an uncaught ReferenceError when trying to handle the WebSocket error, causing the application to crash.
Impact:
Applications using the SDK cannot properly handle cases where the LM Studio server is unavailable, leading to crashes instead of graceful error handling.
Environment:
LM Studio SDK version: 0.4.2
LM Studio: 0.3.5 b9-h
LMS cli: 0.0.28
OS: Windows
The text was updated successfully, but these errors were encountered:
Description:
When the LM Studio WebSocket connection fails (e.g., when trying to connect to an unavailable server), an uncaught ReferenceError is thrown due to an undefined 'event' variable in the error handler.
Steps to Reproduce:
Error Stack Trace:
backend-1 | [2024-12-11T12:44:12.675Z] WARN: LMStudioClient Warning: [LMStudioClient][LLM][ClientPort][WsClientTransport:AuthenticatedWsClientTransport] WebSocket error: connect ECONNREFUSED 192.168.65.254:1234
backend-1 | Stack Trace:
backend-1 | Error: connect ECONNREFUSED 192.168.65.254:1234
backend-1 | at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1278:16)
backend-1 | [2024-12-11T12:44:12.677Z] WARN: LMStudioClient Warning: [LMStudioClient][LLM][ClientPort][WsClientTransport:AuthenticatedWsClientTransport] WebSocket connection refused. This can happen if the server is not running or the client is trying to connect to the wrong path. The server path that this client is attempting to connect to is: ws://host.docker.internal:1234/llm.
backend-1 |
backend-1 | Please make sure the following:
backend-1 |
backend-1 | 1. LM Studio is running
backend-1 |
backend-1 | 2. The API server in LM Studio has started
backend-1 |
backend-1 | 3. The client is attempting to connect to the correct path
backend-1 | /app/node_modules/@lmstudio/sdk/dist/index.cjs:9840
backend-1 | this.errored(event);
backend-1 | ^
backend-1 |
backend-1 | ReferenceError: event is not defined
backend-1 | at AuthenticatedWsClientTransport.onWsError (/app/node_modules/@lmstudio/sdk/dist/index.cjs:9840:22)
backend-1 | at WebSocket. (/app/node_modules/@lmstudio/sdk/dist/index.cjs:9768:61)
backend-1 | at callListener (/app/node_modules/ws/lib/event-target.js:290:14)
backend-1 | at WebSocket.onError (/app/node_modules/ws/lib/event-target.js:230:9)
backend-1 | at WebSocket.emit (node:events:513:28)
backend-1 | at emitErrorAndClose (/app/node_modules/ws/lib/websocket.js:1041:13)
backend-1 | at ClientRequest. (/app/node_modules/ws/lib/websocket.js:881:5)
backend-1 | at ClientRequest.emit (node:events:513:28)
backend-1 | at Socket.socketErrorListener (node:_http_client:494:9)
backend-1 | at Socket.emit (node:events:513:28)
Expected Behavior:
The WebSocket connection failure should be handled gracefully, allowing the application to catch and handle the connection error.
Actual Behavior:
The SDK throws an uncaught ReferenceError when trying to handle the WebSocket error, causing the application to crash.
Impact:
Applications using the SDK cannot properly handle cases where the LM Studio server is unavailable, leading to crashes instead of graceful error handling.
Environment:
The text was updated successfully, but these errors were encountered: