{"record":{"id":"de577bf89777d1a8","repo":"jackwener/OpenCLI","slug":"coupang-search-filtered-navigation-failed-error","errorCode":null,"errorMessage":"coupang search filtered navigation failed: ${error?.message || error}","messagePattern":"coupang search filtered navigation failed: (.+?)","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/coupang/search.js","lineNumber":448,"sourceCode":"        });\n        if (filter) {\n            const filterResult = await page.evaluate(buildApplyFilterEvaluate(filter)).catch((error) => {\n                throw new CommandExecutionError(`coupang search filter evaluation failed: ${error?.message || error}`);\n            });\n            if (!filterResult?.ok) {\n                throw new EmptyResultError('coupang search', `Filter \"${filter}\" was not available on the current page; try without --filter or wait for Coupang to render the filter bar.`);\n            }\n            await page.wait(3).catch((error) => {\n                throw new CommandExecutionError(`coupang search wait failed: ${error?.message || error}`);\n            });\n            if (pageNumber > 1) {\n                const locationInfo = await page.evaluate(buildCurrentLocationEvaluate()).catch((error) => {\n                    throw new CommandExecutionError(`coupang search location evaluation failed: ${error?.message || error}`);\n                });\n                const filteredUrl = new URL(locationInfo?.href || url);\n                filteredUrl.searchParams.set('page', String(pageNumber));\n                await page.goto(filteredUrl.toString()).catch((error) => {\n                    throw new CommandExecutionError(`coupang search filtered navigation failed: ${error?.message || error}`);\n                });\n            }\n        }\n        await page.autoScroll({ times: filter ? 3 : 2, delayMs: 1500 }).catch((error) => {\n            throw new CommandExecutionError(`coupang search scroll failed: ${error?.message || error}`);\n        });\n        const raw = await page.evaluate(buildSearchEvaluate(query, limit, pageNumber)).catch((error) => {\n            throw new CommandExecutionError(`coupang search extraction failed: ${error?.message || error}`);\n        });\n        const loginHints = raw?.loginHints ?? {};\n        const items = Array.isArray(raw?.items) ? raw.items : [];\n        const domItems = Array.isArray(raw?.domItems) ? raw.domItems : [];\n        const normalizedBase = sanitizeSearchItems(items.map((item, index) => normalizeSearchItem(item, index)), limit);\n        const normalizedDom = sanitizeSearchItems(domItems.map((item, index) => normalizeSearchItem(item, index)), Math.max(limit * 6, 60));\n        const normalized = filter\n            ? sanitizeSearchItems(normalizedDom, limit)\n            : mergeSearchItems(normalizedBase, normalizedDom, limit);\n        if (!normalized.length) {","sourceCodeStart":430,"sourceCodeEnd":466,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/coupang/search.js#L430-L466","documentation":"CommandExecutionError wrapping failure of page.goto() to the filtered, paginated URL during a Coupang search with --filter and --page > 1. It indicates navigation to the constructed filteredUrl was rejected.","triggerScenarios":"`coupang search <query> --filter \"...\" --page 2+` where page.goto(filteredUrl) fails — invalid URL built from locationInfo.href, network error, ERR_ABORTED from redirect, or blocked navigation.","commonSituations":"Coupang rejecting deep-links with filter params; flaky network/DNS; navigation interrupted by an on-page redirect; locationInfo.href being a javascript: or about: URL.","solutions":["Retry — transient network failures often resolve","Drop --filter and paginate normally","Check the locationInfo.href value being turned into filteredUrl for malformed URLs","Increase navigation timeout or verify network/proxy settings"],"exampleFix":"// before\nawait page.goto(filteredUrl.toString());\n// after\nawait page.goto(filteredUrl.toString()).catch(() => page.goto(url));","handlingStrategy":"retry","validationCode":"if (pageNumber > 1 && isHttpUrl(locationHref)) { /* safe to goto */ }","typeGuard":"function isHttpUrl(u) { try { const url = new URL(u); return url.protocol === 'https:' || url.protocol === 'http:'; } catch { return false; } }","tryCatchPattern":"try { await search({ filter, page }); } catch (e) { if (/filtered navigation failed/.test(e.message)) { await delay(2000); return retry(); } throw e; }","preventionTips":["Validate the constructed filtered URL is a well-formed http(s) URL","Back off and retry on transient network failures","Test deep-linked filtered URLs in a browser first"],"tags":["browser-automation","navigation","network"],"backgroundTag":"navigation-failed","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}