From 1b9e73fc42b103358a31c12f14f5a362a2eb355e Mon Sep 17 00:00:00 2001 From: Calvin Secrest Date: Fri, 5 Sep 2025 18:37:24 -0400 Subject: [PATCH] fix: guard EventSource when API_BASE_URL unset --- frontend/chat-ui/src/components/ChatWindow.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/chat-ui/src/components/ChatWindow.jsx b/frontend/chat-ui/src/components/ChatWindow.jsx index df6a5ec..0dfaccb 100644 --- a/frontend/chat-ui/src/components/ChatWindow.jsx +++ b/frontend/chat-ui/src/components/ChatWindow.jsx @@ -14,7 +14,8 @@ export default function ChatWindow() { useEffect(() => { if (!state.currentConversation) return; - const url = new URL(`${API_BASE_URL}/stream/${state.currentConversation.id}`); + const base = API_BASE_URL || window.location.origin; + const url = new URL(`/stream/${state.currentConversation.id}`, base); const apiKey = import.meta.env.VITE_API_KEY; if (apiKey) { url.searchParams.set('api_key', apiKey);