{"record":{"id":"ba3e65d26cf8c2dc","repo":"FlowiseAI/Flowise","slug":"no-relative-links-found","errorCode":null,"errorMessage":"No relative links found","messagePattern":"No relative links found","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"packages/components/nodes/documentloaders/Cheerio/Cheerio.ts","lineNumber":199,"sourceCode":"        }\n\n        let docs: IDocument[] = []\n\n        if (relativeLinksMethod) {\n            if (process.env.DEBUG === 'true') options.logger.info(`[${orgId}]: Start CheerioWebBaseLoader ${relativeLinksMethod}`)\n            // if limit is 0 we don't want it to default to 10 so we check explicitly for null or undefined\n            // so when limit is 0 we can fetch all the links\n            if (limit === null || limit === undefined) limit = 10\n            else if (limit < 0) throw new Error('Limit cannot be less than 0')\n            const pages: string[] =\n                selectedLinks && selectedLinks.length > 0\n                    ? selectedLinks.slice(0, limit === 0 ? undefined : limit)\n                    : relativeLinksMethod === 'webCrawl'\n                    ? await webCrawl(url, limit)\n                    : await xmlScrape(url, limit)\n            if (process.env.DEBUG === 'true')\n                options.logger.info(`[${orgId}]: CheerioWebBaseLoader pages: ${JSON.stringify(pages)}, length: ${pages.length}`)\n            if (!pages || pages.length === 0) throw new Error('No relative links found')\n            for (const page of pages) {\n                docs.push(...(await cheerioLoader(page)))\n            }\n            if (process.env.DEBUG === 'true') options.logger.info(`[${orgId}]: Finish CheerioWebBaseLoader ${relativeLinksMethod}`)\n        } else if (selectedLinks && selectedLinks.length > 0) {\n            if (process.env.DEBUG === 'true')\n                options.logger.info(\n                    `[${orgId}]: CheerioWebBaseLoader pages: ${JSON.stringify(selectedLinks)}, length: ${selectedLinks.length}`\n                )\n            for (const page of selectedLinks.slice(0, limit)) {\n                docs.push(...(await cheerioLoader(page)))\n            }\n        } else {\n            docs = await cheerioLoader(url)\n        }\n\n        if (metadata) {\n            const parsedMetadata = typeof metadata === 'object' ? metadata : JSON.parse(metadata)","sourceCodeStart":181,"sourceCodeEnd":217,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/documentloaders/Cheerio/Cheerio.ts#L181-L217","documentation":"After resolving pages via webCrawl, xmlScrape, or selectedLinks.slice, the resulting array is empty. This means there is nothing for CheerioWebBaseLoader to scrape. webCrawl/xmlScrape produced no links, OR selectedLinks after slicing produced nothing (e.g., limit=0 path uses undefined slice which keeps all, but an empty input array yields empty).","triggerScenarios":"Target site has no internal links matching the crawl rules; sitemap.xml is missing or empty (xmlScrape returns []); selectedLinks input array was empty; the seed URL blocks crawlers or returns a JS-only page with no static links.","commonSituations":"Pointing xmlScrape at a site with no /sitemap.xml; webCrawl on a SPA whose links are runtime-rendered; robots.txt or server blocks the user agent.","solutions":["If using xmlScrape, verify https://<host>/sitemap.xml exists and is non-empty.","Switch relativeLinksMethod or provide explicit selectedLinks pointing at known page URLs.","Lower the limit or remove it (0 = all) in case slicing dropped everything.","Check that the seed URL itself returns HTML with anchor tags via curl."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"async function probeSitemap(seedUrl: string): Promise<boolean> {\n  try {\n    const root = new URL(seedUrl)\n    const sitemap = new URL('/sitemap.xml', root)\n    const res = await fetch(sitemap.toString(), { method: 'GET' })\n    if (!res.ok) return false\n    const text = await res.text()\n    return /<urlset|<sitemapindex/i.test(text) && /<loc>/i.test(text)\n  } catch { return false }\n}\n// if (relativeLinksMethod === 'xmlScrape' && !await probeSitemap(url)) warn user","typeGuard":"function hasPages(arr: unknown): arr is string[] {\n  return Array.isArray(arr) && arr.every((x) => typeof x === 'string') && arr.length > 0\n}","tryCatchPattern":"try {\n  // run cheerio init\n} catch (error) {\n  const msg = error instanceof Error ? error.message : String(error)\n  if (/No relative links found/.test(msg)) {\n    // fall back to scraping the seed URL directly\n    docs.push(...(await cheerioLoader(url)))\n  } else throw error\n}","preventionTips":["For xmlScrape, confirm a non-empty /sitemap.xml exists.","Provide explicit selectedLinks when the site has few static anchors.","Crawl a known-good seed URL with a generous limit first to validate link discovery."],"tags":["scraping","content","cheerio","web-crawl"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}