Intelligence Library: - Add full CRUD for Avatar Variants, Geo Intelligence, Spintax, Cartesian - Create reusable DataTable, CRUDModal, DeleteConfirm components - Add TanStack Table for advanced sorting/filtering/pagination - Add React Hook Form + Zod for validated forms - Add export, search, sort, filter capabilities Jumpstart Fix: - Fix 'Error: undefined' when creating generation jobs - Store config instead of full inventory (1456 posts) - Improve error logging - Engine fetches posts directly from WordPress All pages tested and ready for deployment.
2.0 KiB
2.0 KiB
Jumpstart Error Fix - "Error: undefined"
Problem Identified
Location: JumpstartWizard.tsx line 160-169
Error: ❌ Error: undefined after "🚀 IGNITION! Registering Job in System..."
Root Cause:
The createItem('generation_jobs', ...) call is failing because:
- The
filtersfield is trying to store the entire inventory (1456 posts) as JSON - This might exceed Directus field size limits
- The error object doesn't have a
.messageproperty, so it logs "undefined"
Problematic Code:
const job = await client.request(createItem('generation_jobs', {
site_id: siteId,
status: 'Pending',
type: 'Refactor',
target_quantity: inventory.total_posts,
filters: {
items: inventory.items, // ❌ TOO LARGE - 1456 posts!
mode: 'refactor'
}
}));
Solution
Option 1: Store Only Essential Data
Instead of storing all 1456 posts in the job record, store only:
- Post count
- WordPress site URL
- Filter criteria
The engine can fetch posts directly from WordPress when processing.
Option 2: Batch Processing
Create multiple smaller jobs instead of one massive job.
Option 3: Use Separate Table
Store the inventory in a separate job_items table with a foreign key to the job.
Recommended Fix (Option 1)
const job = await client.request(createItem('generation_jobs', {
site_id: siteId,
status: 'Pending',
type: 'Refactor',
target_quantity: inventory.total_posts,
config: {
wordpress_url: siteUrl,
mode: 'refactor',
batch_size: 5
}
}));
Then update the engine to fetch posts directly from WordPress using the stored URL.
Additional Fix: Better Error Logging
} catch (e) {
const errorMsg = e?.message || e?.error || JSON.stringify(e) || 'Unknown error';
addLog(`❌ Error: ${errorMsg}`);
console.error('Full error:', e); // Log full error to console
}
This will show the actual error message instead of "undefined".