firecrawl/open-lovable · error
Scrape data is missing
Error message
Scrape data is missing
What it means
Internal state guard thrown in normal clone mode just before building the generation prompt: scrapeData is null/undefined when the code tries to store it in conversationContext.scrapedWebsites. It means the clone flow reached the prompt-construction stage without a successful scrape result — typically the scrape step was skipped, failed silently upstream, or the variable was reset. This is a logic/state bug guard, not a network error.
Source
Thrown at app/generation/page.tsx:2934
- src/index.css - Include brand fonts, custom shadows/effects, and base styling
- src/App.jsx - Should ONLY render the requested component (e.g., just <PricingPage /> if user wants pricing)
- src/components/[RequestedComponent].jsx - The actual component fulfilling the user's request
TECHNICAL REQUIREMENTS:
- Create a WORKING, self-contained application
- DO NOT import components that don't exist
- Make sure the app renders immediately with visible content
- All colors must match the brand palette EXACTLY
- All spacing must use the ${branding.spacing?.baseUnit || '4'}px base unit
- Buttons must have the exact styling specified in the guidelines
Focus on building something NEW, minimal, and functional that perfectly matches the ${brandGuidelines.styleName || 'brand'} aesthetic and design system.`;
} else {
// === NORMAL CLONE MODE PROMPT ===
// Store scraped data in conversation context
if (!scrapeData) {
throw new Error('Scrape data is missing');
}
setConversationContext(prev => ({
...prev,
scrapedWebsites: [...prev.scrapedWebsites, {
url: url,
content: scrapeData,
timestamp: new Date()
}],
currentProject: `${url} Clone`
}));
// Filter out style-related context when using screenshot/URL-based generation
// Only keep user's explicit instructions, not inherited styles
let filteredContext = homeContextInput;
if (homeUrlInput && homeContextInput) {
// Check if the context contains default style names that shouldn't be inherited
const stylePatterns = [
'Glassmorphism style design',View on GitHub (pinned to 69bd93bae7)
Solutions
- Ensure the scrape step runs and assigns scrapeData before the prompt-building branch — throw or abort early if the scrape failed instead of continuing
- Make the outer catch on the scrape step return/abort the flow rather than fall through to prompt construction
- Verify brandExtensionMode vs clone-mode branching: scrapeData is only set in clone mode, so clone mode must re-run the scrape if missing
- Check for state resets (re-renders, key changes) that clear scrapeData between the scrape and generate steps
Example fix
// before
if (!scrapeData) {
throw new Error('Scrape data is missing');
}
// after
if (!scrapeData) {
addChatMessage('No scraped content available. Re-running the scrape...', 'system');
scrapeData = await scrapeWebsite(url); // retry the scrape before failing
if (!scrapeData) throw new Error('Scrape data is missing');
} Defensive patterns
Strategy: validation
Validate before calling
// before entering prompt construction in clone mode
if (brandExtensionMode) {
if (!brandGuidelines) throw new Error('Brand guidelines are missing');
} else {
if (!scrapeData) throw new Error('Scrape data is missing — run the scrape step first');
} Type guard
function hasScrapeData(d: ScrapeData | null | undefined): d is ScrapeData & { success: true } {
return d !== null && d !== undefined && d.success === true;
} Try / catch
try {
if (!hasScrapeData(scrapeData)) {
throw new Error('Scrape data is missing');
}
setConversationContext(prev => ({ ...prev, scrapedWebsites: [...prev.scrapedWebsites, { url, content: scrapeData }] }));
} catch (err: any) {
addChatMessage(`Cannot generate: ${err.message}. Please scrape the site first.`, 'system');
return; // abort the flow instead of continuing with missing state
} Prevention
- Abort the flow (return/throw out of the handler) when a prerequisite step fails instead of falling through
- Keep scrapeData and mode flags (brandExtensionMode) in sync — derive one from the other where possible
- Guard both branches: brand mode needs brandGuidelines, clone mode needs scrapeData
- Avoid resetting state between scrape and generate steps (stable component keys, single flow function)
- Add an assertion/log when scrapeData is unexpectedly null to catch silent upstream failures
When it happens
Trigger: Entering clone-mode prompt building with !scrapeData: the scrape branch threw earlier but was caught and swallowed, the brand-extension branch ran but mode detection later treated it as clone mode, or scrapeData was never assigned due to a conditional path that bypassed the scraping step.
Common situations: User cancels or partially completes the scrape step then proceeds; mixed-mode URL flows where brandExtensionMode toggles after scrapeData initialization; component re-render/state reset clearing scrapeData between steps; earlier scrape error caught by an outer try/catch that only logged, letting execution continue.
Related errors
- Failed to scrape content
- Failed to scrape website
- Failed to extract brand styles
- ${brandGuidelines.error || 'Failed to extract brand styles'}
- Failed to scrape website
AI-assisted analysis of firecrawl/open-lovable@69bd93bae7 (2026-08-28).
Data as JSON: /api/errors/716b2a6a47468cc4.
Report an issue: GitHub.