{"record":{"id":"f15a36b93033fb67","repo":"jackwener/OpenCLI","slug":"trip-com-transfer-listing-did-not-render-state","errorCode":null,"errorMessage":"Trip.com transfer listing did not render (state=${String(waitResult)}); check the city and airport code","messagePattern":"Trip\\.com transfer listing did not render \\(state=(.+?)\\); check the city and airport code","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/trip/transfer.js","lineNumber":59,"sourceCode":"        'price', 'currency',\n        'url',\n    ],\n    func: async (page, kwargs) => {\n        const city = parseKeyword('city', kwargs.city);\n        const airport = parseIataCode('airport', kwargs.airport);\n        const limit = parseListLimit(kwargs.limit);\n\n        const listUrl = buildTransferListUrl(city, airport);\n        await page.goto(listUrl);\n        const waitResult = await page.evaluate(WAIT_FOR_TRANSFERS_JS);\n        if (waitResult === 'captcha') {\n            throw new AuthRequiredError('trip.com', 'Trip.com is asking for a verification; complete it in your browser session and retry');\n        }\n        if (waitResult === 'empty') {\n            throw new EmptyResultError('trip transfer', `No airport transfers for ${city} (${airport})`);\n        }\n        if (waitResult !== 'content') {\n            throw new CommandExecutionError(`Trip.com transfer listing did not render (state=${String(waitResult)}); check the city and airport code`);\n        }\n        const landedPath = await page.evaluate('location.pathname');\n        if (!/\\/airport-transfers\\/[^/]+\\/airport-[^/]+/i.test(String(landedPath))) {\n            throw new CommandExecutionError(`Trip.com bounced ${city} / ${airport} to the transfer landing; check the city name matches the airport IATA code`);\n        }\n        const raw = await page.evaluate(buildTransferExtractJs());\n        if (!Array.isArray(raw)) {\n            throw new CommandExecutionError('Trip.com transfer DOM extraction returned malformed rows');\n        }\n        if (raw.length === 0) {\n            throw new CommandExecutionError('Trip.com transfer cards rendered but parser did not find required price anchors');\n        }\n        return raw.slice(0, limit).map((r, i) => ({\n            rank: i + 1,\n            type: r.type,\n            passengers: r.passengers,\n            luggage: r.luggage,\n            price: r.price,","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/trip/transfer.js#L41-L77","documentation":"CommandExecutionError thrown when the transfer page loaded but never reached the 'content' state (and was not 'captcha' or 'empty'). Trip.com's results area never rendered, so the message includes the observed state to debug whether it was a timeout, a redirect, or something else.","triggerScenarios":"Invalid or unrecognized city/airport-code combination causing Trip.com to spin or stall on the search page; slow network exceeding the wait timeout; client-side JS error on Trip.com preventing render.","commonSituations":"Wrong airport code format (city name instead of IATA); flaky hotel/café network; Trip.com front-end deploy introducing a runtime error; headless browser missing features the page needs.","solutions":["Check the city and airport code arguments for correctness","Read the state value in the message and retry if it indicates timeout","Test the equivalent transfer URL in a real browser","Update the WAIT_FOR_TRANSFERS_JS probe if Trip.com changed its loading markers"],"exampleFix":"// before\nawait getTransfers({ city: 'london heathrow', airport: 'Heathrow' });\n// after\nawait getTransfers({ city: 'London', airport: 'LHR' });","handlingStrategy":"retry","validationCode":"if (!/^[A-Z]{3}$/.test(airport)) throw new Error(`airport must be IATA code, got ${airport}`);\nif (!city) throw new Error('city required');","typeGuard":"null","tryCatchPattern":"try {\n  const rows = await getTransfers(args);\n} catch (e) {\n  if (/did not render \\(state=/.test(e.message)) {\n    await sleep(2000);\n    return getTransfers(args); // single retry\n  }\n  throw e;\n}","preventionTips":["Pass a real IATA code, not the airport's full name","Retry once with backoff on non-content states","Keep WAIT_FOR_TRANSFERS_JS markers updated with Trip.com's UI","Test on a stable network; timeouts correlate with slow loads"],"tags":["scraping","dom-render","trip-com","timeout"],"backgroundTag":"page-render-timeout","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}