5.3 KiB
Frontend Pages Fix - Complete Summary
🐛 Issues Found Using Debug Tools
Tool Used: Browser Dev Tools (Console + Network tabs)
Error Discovered: Error: No QueryClient set, use QueryClientProvider to set one
Root Causes Identified:
-
Domain Mismatch (Fixed in commit
ab8511f)- Frontend at
launch.jumpstartscaling.com - Was trying to connect to
spark.jumpstartscaling.com - Fix: Updated
PUBLIC_DIRECTUS_URLenvironment variable
- Frontend at
-
Missing QueryClient Provider (Fixed in commit
21a923d)- React components using TanStack Query hooks
- No
QueryClientProviderwrapping the components - Fix: Added
CoreProvidertoAdminLayout.astro
✅ Fixes Applied
Fix #1: Update Directus URL Configuration
File: docker-compose.yaml
Changes:
# Directus configuration
CORS_ORIGIN: 'https://launch.jumpstartscaling.com,https://spark.jumpstartscaling.com,http://localhost:4321'
PUBLIC_URL: 'https://launch.jumpstartscaling.com'
# Frontend configuration
PUBLIC_DIRECTUS_URL: 'https://launch.jumpstartscaling.com'
Commits: c7e6dcb, ab8511f
Fix #2: Add QueryClient Provider to All Admin Pages
File: frontend/src/layouts/AdminLayout.astro
Changes:
// Import CoreProvider
import { GlobalToaster, CoreProvider } from '@/components/providers/CoreProviders';
// Wrap main content
<main class="p-8 pb-24">
<CoreProvider client:load>
<slot />
</CoreProvider>
</main>
Benefit: ALL admin pages now automatically have QueryClient context
Commit: 21a923d
🧪 Testing After Deployment
Once Coolify completes the frontend rebuild, all these pages should work:
✅ Pages to Test:
-
Avatar Intelligence
- https://launch.jumpstartscaling.com/admin/content/avatars
- Should show empty table or data grid
-
Geo Intelligence
- https://launch.jumpstartscaling.com/admin/collections/geo-intelligence
- Should show map/list view
-
Sites Manager
- https://launch.jumpstartscaling.com/admin/sites
- Should show sites list (with 1 test site)
-
All Other Admin Pages
- All pages in the user's list should now work
- No more "Internal server error"
- No more QueryClient errors
📊 Expected Results
Before Fix:
- ❌ "Internal server error" on all pages
- ❌ Console error:
No QueryClient set - ❌ No data loading
After Fix:
- ✅ Pages load successfully
- ✅ Empty data tables (no data yet) OR
- ✅ Data grids with test data
- ✅ No console errors
- ✅ Network requests to
/items/{collection}return 200 OK
🔍 How to Verify
-
Wait for Coolify Deployment
- Check Coolify dashboard
- Wait for "frontend" service to finish rebuilding (~2-5 minutes)
-
Open Browser Dev Tools
F12 or Right-click → Inspect -
Navigate to Any Admin Page
https://launch.jumpstartscaling.com/admin/content/avatars -
Check Console Tab
- Should be NO errors
- Should see successful API calls
-
Check Network Tab
- Look for requests to:
https://launch.jumpstartscaling.com/items/avatar_intelligence - Should see:
200 OKstatus - Response should be:
{"data": []}
- Look for requests to:
🚀 Deployment Status
Commits Pushed:
c7e6dcb- Updated Directus PUBLIC_URL and CORSab8511f- Updated frontend PUBLIC_DIRECTUS_URL005b0fc- Added troubleshooting documentation21a923d- Added CoreProvider to AdminLayout
Services Updated:
- ✅ Directus (manually restarted)
- 🔄 Frontend (waiting for Coolify auto-deploy)
Files Modified:
docker-compose.yaml(2 changes)frontend/src/layouts/AdminLayout.astro(1 change)frontend/src/pages/admin/content/avatars.astro(1 change)frontend/src/pages/admin/collections/geo-intelligence.astro(1 change)frontend/src/pages/admin/sites/index.astro(1 change)
📝 What We Learned
Debug Tools Are Essential!
Using browser dev tools revealed the actual error (No QueryClient set) instead of the generic "Internal server error" message.
Key Debugging Steps:
- ✅ Open Console tab - See JavaScript errors
- ✅ Open Network tab - See API requests/responses
- ✅ Check request URLs - Verify correct domain
- ✅ Check response status - 200 OK vs 500 Error
- ✅ Read error messages - They tell you exactly what's wrong!
The Fix Was Simple:
- Add one wrapper component (
CoreProvider) - Update one environment variable (
PUBLIC_DIRECTUS_URL) - Total lines changed: ~10 lines
🤖 For Future AI Agents
When debugging frontend issues:
-
Always use browser dev tools first
- Console for JavaScript errors
- Network for API calls
- Don't guess - look at actual errors!
-
Check environment variables
- Verify
PUBLIC_DIRECTUS_URLis correct - Check if build-time vs runtime variables
- Verify
-
Verify React Context Providers
- TanStack Query needs
QueryClientProvider - Should be in layout or root component
- All child components inherit the context
- TanStack Query needs
-
Test incrementally
- Fix one issue at a time
- Verify each fix before moving on
- Use browser to confirm fixes work
Fix Applied: December 14, 2025 10:35 AM EST
Status: 🔄 Waiting for Coolify Deployment
ETA: 2-5 minutes for frontend rebuild