{"record":{"id":"a5c877fa5f4b7f94","repo":"FlowiseAI/Flowise","slug":"firecrawl-failed-to-search-warning-response-w","errorCode":null,"errorMessage":"Firecrawl: Failed to search. Warning: ${response.warning}","messagePattern":"Firecrawl: Failed to search\\. Warning: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"packages/components/nodes/documentloaders/FireCrawl/FireCrawl.ts","lineNumber":585,"sourceCode":"        this.apiKey = apiKey\n        this.url = url\n        this.query = query\n        this.mode = mode\n        this.params = params\n        this.apiUrl = apiUrl || 'https://api.firecrawl.dev'\n    }\n\n    public async load(): Promise<DocumentInterface[]> {\n        const app = new FirecrawlApp({ apiKey: this.apiKey, apiUrl: this.apiUrl })\n        let firecrawlDocs: FirecrawlDocument[]\n\n        if (this.mode === 'search') {\n            if (!this.query) {\n                throw new Error('Firecrawl: Query is required for search mode')\n            }\n            const response = await app.search({ query: this.query, ...this.params })\n            if (!response.success) {\n                throw new Error(`Firecrawl: Failed to search. Warning: ${response.warning}`)\n            }\n\n            // Convert search results to FirecrawlDocument format\n            firecrawlDocs = (response.data || []).map((result) => ({\n                markdown: result.description,\n                metadata: {\n                    title: result.title,\n                    sourceURL: result.url,\n                    description: result.description\n                }\n            }))\n        } else if (this.mode === 'scrape') {\n            if (!this.url) {\n                throw new Error('Firecrawl: URL is required for scrape mode')\n            }\n            const response = await app.scrapeUrl(this.url, this.params)\n            if (!response.success) {\n                throw new Error(`Firecrawl: Failed to scrape URL. Error: ${response.error}`)","sourceCodeStart":567,"sourceCodeEnd":603,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/documentloaders/FireCrawl/FireCrawl.ts#L567-L603","documentation":"Thrown by FireCrawlLoader.load() in search mode when app.search resolves but the response has `success: false`. Embeds the upstream `warning` field. This is the loader-level echo of [122] — note app.search itself throws [122]/[123], so reaching this line is rare.","triggerScenarios":"app.search returns (without throwing) a SearchResponse where `success === false`. In practice app.search throws [122] before returning, so this branch is a defensive duplicate. If reached, it indicates a future refactor where app.search stops throwing on failure.","commonSituations":"Library refactor decouples app.search throwing from the success flag; mocked/stubbed FirecrawlApp in tests returning `{ success: false }`.","solutions":["Inspect response.warning for the upstream reason.","Retry the search with a simpler query or relaxed filters.","If using a mock, return `{ success: true, data: [...] }` from your test double.","Patch the duplicate check to log rather than throw if you want best-effort behavior."],"exampleFix":"// before\nconst response = await app.search({ query: this.query, ...this.params })\nif (!response.success) throw new Error(`Firecrawl: Failed to search. Warning: ${response.warning}`)\n\n// after\nconst response = await app.search({ query: this.query, ...this.params })\nif (!response.success) {\n  console.warn('Firecrawl search soft-failed:', response.warning)\n  firecrawlDocs = []\n}","handlingStrategy":"fallback","validationCode":"const query = (params.query || '').trim()\nif (!query) throw new Error('search requires a query')","typeGuard":"function isSearchSuccess(r: SearchResponse | undefined): r is SearchResponse & { success: true } {\n  return !!r && r.success === true\n}","tryCatchPattern":"let docs: DocumentInterface[] = []\ntry { docs = await loader.load() }\ncatch (e) { if (/Failed to search/.test((e as Error).message)) return []; throw e }","preventionTips":["Cache prior successful results to ride out soft failures.","Log response.warning for diagnosis.","Use this as best-effort; surface warnings to the user."],"tags":["firecrawl","search","soft-failure","loader","redundant"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}