Skip to content

Latest commit

 

History

History
115 lines (91 loc) · 4.02 KB

File metadata and controls

115 lines (91 loc) · 4.02 KB

🔧 WebLLM Extension Troubleshooting Guide

Critical Fixes Applied

1. Module Loading Issue - FIXED

  • Problem: Uncaught SyntaxError: Cannot use import statement outside a module
  • Root Cause: offscreen.html was loading offscreen.js as regular script instead of ES6 module
  • Fix Applied: Added type="module" to script tag in offscreen.html
  • Status: ✅ RESOLVED

2. Offscreen Document Configuration - FIXED

  • Problem: Wrong offscreen reason in manifest
  • Root Cause: Using "DOM_SCRAPING" instead of "WORKERS"
  • Fix Applied: Updated to "WORKERS" for WebLLM processing
  • Status: ✅ RESOLVED

🧪 Testing Steps

Step 1: Reload Extension

  1. Go to chrome://extensions/
  2. Find your "Transcript Extractor" extension
  3. Click the reload/refresh button (🔄)
  4. This ensures the new offscreen.html and manifest are loaded

Step 2: Check Console for Errors

  1. Open Chrome DevTools (F12)
  2. Go to Console tab
  3. Look for these messages:
    • 🎯 Offscreen: WebLLM offscreen document ready
    • 🎯 Background: Offscreen document already exists
    • ❌ Should NOT see: Cannot use import statement outside a module

Step 3: Test WebLLM Integration

  1. Go to a Udemy course page (like the one you were testing)
  2. Open the extension popup
  3. Try to extract a transcript
  4. Click "AI Summarize" button
  5. Expected Behavior:
    • Should see WebLLM loading progress
    • Should get a summary (not timeout error)
    • Console should show WebLLM initialization messages

Step 4: Enable WebGPU (Optional but Recommended)

  1. Go to chrome://flags/#enable-unsafe-webgpu
  2. Set to "Enabled"
  3. Restart Chrome
  4. This will make WebLLM much faster

🔍 Debugging Console Messages

✅ Good Messages (Extension Working)

🎯 Background: Setting up message handlers...
🎯 Background: Ensuring offscreen document exists...
✅ Background: Offscreen document already exists
🎯 Offscreen: WebLLM offscreen document ready
🎯 Offscreen: Starting WebLLM initialization...
✅ Offscreen: WebLLM model initialized successfully

❌ Bad Messages (Still Broken)

Uncaught SyntaxError: Cannot use import statement outside a module
Failed to load resource: net::ERR_FAILED
AI summarization timeout

🚨 If Still Not Working

Check 1: Extension Reload

  • Make sure you reloaded the extension after the fix
  • The old offscreen document might still be cached

Check 2: Clear Extension Data

  1. Go to chrome://extensions/
  2. Click "Details" on your extension
  3. Click "Extension options" or "Inspect views: offscreen document"
  4. Clear any cached data

Check 3: Check Offscreen Document

  1. In Chrome DevTools, go to Application tab
  2. Look for "Offscreen Documents" in the left sidebar
  3. Should see your extension's offscreen document
  4. Check if it loaded without errors

Check 4: WebGPU Status

  1. Open chrome://gpu/ in a new tab
  2. Look for "WebGPU" status
  3. Should show "Hardware accelerated" if WebGPU is enabled

📊 Expected Performance

WebGPU Status Initial Load Subsequent Use
Enabled ~30-60 seconds ~5-10 seconds
Disabled ~60-120 seconds ~10-20 seconds

🎯 Success Indicators

  1. No Syntax Errors in console
  2. WebLLM Initialization messages appear
  3. AI Summarization works (no timeout)
  4. Progress Updates during model loading
  5. Summary Generated successfully

📞 Still Having Issues?

If the extension still shows "AI summarization timeout":

  1. Check Console: Look for any remaining error messages
  2. Check Network: Ensure no network issues blocking model download
  3. Check WebGPU: Verify WebGPU is enabled for better performance
  4. Restart Chrome: Sometimes a full restart helps clear cached issues

The fixes should resolve the Cannot use import statement outside a module error that was causing the summarization timeout!