{"record":{"id":"f950b09e816df5a5","repo":"FlowiseAI/Flowise","slug":"invalid-url-f950b0","errorCode":null,"errorMessage":"Invalid URL","messagePattern":"Invalid URL","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/documentloaders/Playwright/Playwright.ts","lineNumber":188,"sourceCode":"            | 'domcontentloaded'\n            | 'networkidle'\n            | 'commit'\n            | undefined\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 playwrightLoader(url: string): Promise<Document[] | undefined> {\n            try {\n                await checkDenyList(url)\n                let docs = []\n\n                const executablePath = process.env.PLAYWRIGHT_EXECUTABLE_PATH\n\n                const config: PlaywrightWebBaseLoaderOptions = {\n                    launchOptions: {\n                        args: ['--no-sandbox'],\n                        headless: true,\n                        executablePath: executablePath\n                    }\n                }\n                if (waitUntilGoToOption) {\n                    config['gotoOptions'] = {","sourceCodeStart":170,"sourceCodeEnd":206,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/documentloaders/Playwright/Playwright.ts#L170-L206","documentation":"Thrown by the Playwright loader init() when linkifyjs' test(url) returns false for the trimmed input URL. test() only validates strings that look like real URLs (scheme + host), so a bare domain, missing protocol, or malformed string fails.","triggerScenarios":"Input is 'example.com' without a scheme; input is 'example' with no dot/TLD; input has leading/trailing junk that survives .trim(); input is empty; input is a relative path like '/page'.","commonSituations":"User pastes a domain without https://; URL field bound to a variable that resolved to undefined then coerced to 'undefined'; copy-paste introduces a leading space or smart quote; using a localhost/internal host that linkifyjs does not recognize.","solutions":["Prepend the scheme: ensure input is 'https://example.com' not 'example.com'.","Normalize with new URL(url) before validation to catch scheme-less inputs.","Trim and strip stray characters (smart quotes, zero-width spaces) before testing.","If you must allow internal/localhost hosts, validate with a custom regex instead of linkifyjs test()."],"exampleFix":"// before\nlet url = nodeData.inputs?.url as string\nurl = url.trim()\nif (!test(url)) throw new Error('Invalid URL')\n// after - normalize scheme first, use the URL constructor as source of truth\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 http:// or https:// scheme.","Use new URL() as the authoritative validator.","Strip smart quotes and zero-width characters from pasted URLs.","For internal hosts, use a custom regex instead of linkifyjs test()."],"tags":["playwright","url-validation","linkifyjs","scraping"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}