- Problem:
Uncaught SyntaxError: Cannot use import statement outside a module - Root Cause:
offscreen.htmlwas loadingoffscreen.jsas regular script instead of ES6 module - Fix Applied: Added
type="module"to script tag inoffscreen.html - Status: ✅ RESOLVED
- Problem: Wrong offscreen reason in manifest
- Root Cause: Using
"DOM_SCRAPING"instead of"WORKERS" - Fix Applied: Updated to
"WORKERS"for WebLLM processing - Status: ✅ RESOLVED
- Go to
chrome://extensions/ - Find your "Transcript Extractor" extension
- Click the reload/refresh button (🔄)
- This ensures the new
offscreen.htmland manifest are loaded
- Open Chrome DevTools (
F12) - Go to Console tab
- Look for these messages:
- ✅
🎯 Offscreen: WebLLM offscreen document ready - ✅
🎯 Background: Offscreen document already exists - ❌ Should NOT see:
Cannot use import statement outside a module
- ✅
- Go to a Udemy course page (like the one you were testing)
- Open the extension popup
- Try to extract a transcript
- Click "AI Summarize" button
- Expected Behavior:
- Should see WebLLM loading progress
- Should get a summary (not timeout error)
- Console should show WebLLM initialization messages
- Go to
chrome://flags/#enable-unsafe-webgpu - Set to "Enabled"
- Restart Chrome
- This will make WebLLM much faster
🎯 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
Uncaught SyntaxError: Cannot use import statement outside a module
Failed to load resource: net::ERR_FAILED
AI summarization timeout
- Make sure you reloaded the extension after the fix
- The old offscreen document might still be cached
- Go to
chrome://extensions/ - Click "Details" on your extension
- Click "Extension options" or "Inspect views: offscreen document"
- Clear any cached data
- In Chrome DevTools, go to Application tab
- Look for "Offscreen Documents" in the left sidebar
- Should see your extension's offscreen document
- Check if it loaded without errors
- Open
chrome://gpu/in a new tab - Look for "WebGPU" status
- Should show "Hardware accelerated" if WebGPU is enabled
| WebGPU Status | Initial Load | Subsequent Use |
|---|---|---|
| ✅ Enabled | ~30-60 seconds | ~5-10 seconds |
| ❌ Disabled | ~60-120 seconds | ~10-20 seconds |
- No Syntax Errors in console
- WebLLM Initialization messages appear
- AI Summarization works (no timeout)
- Progress Updates during model loading
- Summary Generated successfully
If the extension still shows "AI summarization timeout":
- Check Console: Look for any remaining error messages
- Check Network: Ensure no network issues blocking model download
- Check WebGPU: Verify WebGPU is enabled for better performance
- 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!