From 249e4ca41502cd230e7e7515f44aedbe466eabe3 Mon Sep 17 00:00:00 2001 From: KV-Tube Deployer Date: Tue, 20 Jan 2026 07:35:37 +0700 Subject: [PATCH] v3.1.4: Fix WebLLMService undefined - use window attached class pattern --- static/js/webllm-service.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/static/js/webllm-service.js b/static/js/webllm-service.js index a7bd728..b69ff41 100755 --- a/static/js/webllm-service.js +++ b/static/js/webllm-service.js @@ -4,9 +4,9 @@ */ // Guard against redeclaration on SPA navigation -if (typeof WebLLMService === 'undefined') { +if (typeof window.WebLLMService === 'undefined') { - class WebLLMService { + window.WebLLMService = class WebLLMService { constructor() { this.engine = null; this.isLoading = false; @@ -335,7 +335,7 @@ Do NOT copy sentences from the transcript. Instead, synthesize the core ideas in } // Global singleton instance - window.webLLMService = new WebLLMService(); + window.webLLMService = new window.WebLLMService(); // Export for module usage if (typeof module !== 'undefined' && module.exports) {