{"record":{"id":"1bc36ff875bf1192","repo":"FlowiseAI/Flowise","slug":"invalid-url-1bc36f","errorCode":null,"errorMessage":"Invalid URL","messagePattern":"Invalid URL","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/documentloaders/Puppeteer/Puppeteer.ts","lineNumber":179,"sourceCode":"        const relativeLinksMethod = nodeData.inputs?.relativeLinksMethod as string\n        const selectedLinks = nodeData.inputs?.selectedLinks as string[]\n        let limit = parseInt(nodeData.inputs?.limit as string)\n        const waitUntilGoToOption = nodeData.inputs?.waitUntilGoToOption as PuppeteerLifeCycleEvent\n        const waitForSelector = nodeData.inputs?.waitForSelector as string\n        const cssSelector = nodeData.inputs?.cssSelector as string\n        const _omitMetadataKeys = nodeData.inputs?.omitMetadataKeys as string\n        const output = nodeData.outputs?.output as string\n        const orgId = options.orgId\n\n        let omitMetadataKeys: string[] = []\n        if (_omitMetadataKeys) {\n            omitMetadataKeys = _omitMetadataKeys.split(',').map((key) => key.trim())\n        }\n\n        let url = nodeData.inputs?.url as string\n        url = url.trim()\n        if (!test(url)) {\n            throw new Error('Invalid URL')\n        }\n\n        async function puppeteerLoader(url: string): Promise<Document[] | undefined> {\n            try {\n                await checkDenyList(url)\n                let docs: Document[] = []\n\n                const executablePath = process.env.PUPPETEER_EXECUTABLE_PATH\n\n                const config: PuppeteerWebBaseLoaderOptions = {\n                    launchOptions: {\n                        args: ['--no-sandbox'],\n                        headless: 'new',\n                        executablePath: executablePath\n                    }\n                }\n                if (waitUntilGoToOption) {\n                    config['gotoOptions'] = {","sourceCodeStart":161,"sourceCodeEnd":197,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/documentloaders/Puppeteer/Puppeteer.ts#L161-L197","documentation":"Puppeteer loader equivalent of [170]: thrown when linkifyjs test(url) is false for the trimmed input URL. Same validation semantics — requires a scheme and a recognizable host.","triggerScenarios":"Input 'example.com' (no scheme); bare hostname without TLD; empty string; relative path; smart-quote/whitespace contamination.","commonSituations":"Domain pasted without https://; variable resolved to undefined coerced to string; internal/localhost host not recognized by linkifyjs.","solutions":["Prepend https:// when the scheme is missing.","Validate with new URL() as the authoritative check.","Trim and strip stray characters.","Use a custom regex for internal hosts if needed."],"exampleFix":"// before\nlet url = nodeData.inputs?.url as string\nurl = url.trim()\nif (!test(url)) throw new Error('Invalid URL')\n// after\nlet url = (nodeData.inputs?.url as string)?.trim() ?? ''\nif (!/^https?:\\/\\//i.test(url)) url = `https://${url}`\ntry { new URL(url) } catch { throw new Error(`Invalid URL: ${url}`) }","handlingStrategy":"validation","validationCode":"function normalizeAndValidateUrl(raw) {\n  let u = (raw ?? '').toString().trim()\n  if (!u) throw new Error('URL is required')\n  if (!/^https?:\\/\\//i.test(u)) u = `https://${u}`\n  try { new URL(u) } catch { throw new Error(`Invalid URL: ${u}`) }\n  return u\n}","typeGuard":"function isValidHttpUrl(s) {\n  try { const u = new URL(s); return u.protocol === 'http:' || u.protocol === 'https:' }\n  catch { return false }\n}","tryCatchPattern":null,"preventionTips":["Always include the scheme (https://).","Use new URL() as the validator.","Strip smart quotes/whitespace from pasted URLs.","Use a custom regex for internal/localhost hosts."],"tags":["puppeteer","url-validation","linkifyjs","scraping"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}