Highlights are not displaying in the Highlights tab on the analyze page.
Terminal 1 - Backend:
cd /Users/hrishikesh/Desktop/video-to-reel/backend
python app.pyTerminal 2 - Frontend:
cd /Users/hrishikesh/Desktop/video-to-reel/frontend
npm run dev- Open
http://localhost:3000in your browser - Open DevTools Console (F12 or Cmd+Option+I)
- Select any video from dropdown and click "Generate Reel"
- On the analyze page, you'll see debug controls
Click the "🧪 Load Test Data" button
This will load 3 test highlights directly into the state without calling the API.
- The UI rendering is working correctly
- Problem is with the API response or data flow
- Check browser console for API response logs
- Check backend terminal for highlight parsing logs
- There's a React rendering issue
- Check browser console for React errors
- The Tabs component might have an issue
- Try refreshing the page
After loading the page, look for these console logs:
🔍 Fetching highlights for video: <video_id>
[API] Calling highlights endpoint: http://127.0.0.1:5000/api/highlights/<video_id>
[API] Highlights response: {...}
📦 Highlights API Response: {...}
✅ Success: true/false
📊 Highlights data: [...]
📈 Highlights count: X
🔍 Highlights array check: true/falseKey Things to Check:
-
Is
success: true?- If false, check the error message
- Might be API key issue
-
Is
highlightsan array?- Should be:
Array(X) - If not, the response format is wrong
- Should be:
-
Is the count > 0?
- If 0, no highlights were parsed from analysis
- Check backend logs
In the backend terminal, look for:
============================================================
🔍 GENERATING HIGHLIGHTS FOR VIDEO: <video_id>
============================================================
============================================================
📦 RAW ANALYSIS RESPONSE:
============================================================
<This is the actual text from TwelveLabs>
============================================================
============================================================
✨ PARSED HIGHLIGHTS: X found
============================================================
1. Title [start ~ end]
2. Title [start ~ end]
============================================================
Common Issues:
Cause: The TwelveLabs response doesn't match the expected format.
Expected format:
**Highlight Title**: [0s~30s]
**Another Highlight**: [35s~60s]
Check: Look at the "RAW ANALYSIS RESPONSE" - does it have timestamps in square brackets?
Fix: If the format is different, we need to update the regex in:
backend/service/twelvelabs_service.py line 131
Error: TwelveLabs API key is required
Fix:
cd /Users/hrishikesh/Desktop/video-to-reel/backend
echo "TWELVELABS_API_KEY=your_actual_key_here" >> .envOn the analyze page, click the "🔄 Refresh Highlights" button.
This will manually trigger the highlights API call. Watch the console for logs.
In DevTools:
- Go to Network tab
- Filter by "highlights"
- Click "🔄 Refresh Highlights"
- Click on the
highlights/<video_id>request - Check the Response tab
You should see:
{
"success": true,
"highlights": [
{
"title": "...",
"start": 0,
"end": 15
}
],
"video_id": "...",
"summary": "..."
}Diagnosis: API response issue Action: Share the Network tab response with me
Diagnosis: React rendering issue Action: Check browser console for errors
Diagnosis: Network/CORS issue Action: Check if backend URL is correct (should be http://127.0.0.1:5000)
Diagnosis: TwelveLabs response format mismatch Action: Share the "RAW ANALYSIS RESPONSE" from backend logs
The analyze page now has these debug buttons:
- 🔄 Refresh Highlights - Manually trigger API call
- 🧪 Load Test Data - Load 3 test highlights (bypasses API)
- 🗑️ Clear - Clear all highlights
Plus a status display showing:
State: X highlights | Loading: true/false | Array: yes/no
🔄 Highlights state changed: 3 highlights
📋 Current highlights: (3) [{…}, {…}, {…}]
Highlights (3)
Debug: 3 highlights loaded
Found 3 highlights ready to convert into reels
[Card 1]
[Card 2]
[Card 3]
Please try the test steps above and let me know:
- ✅ Does the "🧪 Load Test Data" button work?
- ✅ What do you see in the browser console when the page loads?
- ✅ What appears in the backend terminal?
- ✅ What does the Network tab show for the highlights response?
With this information, I can pinpoint the exact issue! 🎯