{"record":{"id":"38242a60a0741e0b","repo":"jackwener/OpenCLI","slug":"no-data-38242a","errorCode":"NO_DATA","errorMessage":"No products found for category \"${slug}\"","messagePattern":"No products found for category \"(.+?)\"","errorType":"error_code","errorClass":"CliError","httpStatus":null,"severity":"error","filePath":"clis/producthunt/browse.js","lineNumber":90,"sourceCode":"            }\n            container = container.parentElement;\n          }\n\n          seen.add(href);\n          results.push({\n            name,\n            tagline: tagline.slice(0, 120),\n            reviews: reviews || '0',\n            url: 'https://www.producthunt.com' + href,\n          });\n        }\n\n        return results;\n      })()\n    `);\n        const items = Array.isArray(domItems) ? domItems : [];\n        if (items.length === 0) {\n            throw new CliError('NO_DATA', `No products found for category \"${slug}\"`, 'Check the category slug or try: ' + PRODUCTHUNT_CATEGORY_SLUGS.slice(0, 5).join(', '));\n        }\n        return items.slice(0, count).map((item, i) => ({\n            rank: i + 1,\n            name: item.name,\n            tagline: item.tagline,\n            reviews: item.reviews,\n            url: item.url,\n        }));\n    },\n});\n","sourceCodeStart":72,"sourceCodeEnd":101,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/producthunt/browse.js#L72-L101","documentation":"A CliError with code NO_DATA thrown by the producthunt browse command when, after navigating to https://www.producthunt.com/categories/<slug> and running the interceptor + DOM extraction, zero product cards were found. The error message includes the offending category slug and a hint listing valid category slugs, so it signals either a bad/typo'd slug or that the page rendered no product cards for that category.","triggerScenarios":"Calling producthunt browse with a category positional arg that is not one of PRODUCTHUNT_CATEGORY_SLUGS (typo, spacing, wrong casing handled only by toLowerCase), or a slug page that loads but yields no a[href^=\"/products/\"] cards matching the flex-col filter (layout change, empty category, or capture timeout within waitForCapture(5)).","commonSituations":"Typo'd or invented slug like 'ai' instead of a real Product Hunt category; Product Hunt renamed/removed a category slug; page needs login or shows an interstitial so no product cards render; Product Hunt DOM/class-name change breaking the card-link selector; slow network exceeding the 5s capture window.","solutions":["Use a valid slug from PRODUCTHUNT_CATEGORY_SLUGS (the error hint lists the first five) — e.g. developer-tools, ai-agents.","Verify the slug against https://www.producthunt.com/categories in a browser to confirm the category page exists and lists products.","Re-run later or increase the capture wait if it was a transient network/render timeout.","If the page renders but extraction is empty, update the DOM selector (a[href^=\"/products/\"] + flex-col class) to match Product Hunt's current markup."],"exampleFix":"// before\nawait cli browse producthunt \"artifical-intelligence\"\n// CliError NO_DATA: No products found for category \"artifical-intelligence\"\n// after\nawait cli browse producthunt \"artificial-intelligence\"","handlingStrategy":"validation","validationCode":"import { PRODUCTHUNT_CATEGORY_SLUGS } from './utils.js';\nfunction validateCategorySlug(slug) {\n  const s = String(slug || '').trim().toLowerCase();\n  if (!PRODUCTHUNT_CATEGORY_SLUGS.includes(s)) {\n    throw new Error(`Invalid category slug \"${s}\". Valid: ${PRODUCTHUNT_CATEGORY_SLUGS.join(', ')}`);\n  }\n  return s;\n}","typeGuard":"function isValidCategorySlug(slug) {\n  return typeof slug === 'string' && PRODUCTHUNT_CATEGORY_SLUGS.includes(slug.trim().toLowerCase());\n}","tryCatchPattern":"try {\n  products = await browseProducthunt(slug, { limit });\n} catch (err) {\n  if (err?.code === 'NO_DATA') {\n    console.error(`No products for \"${slug}\" — try a valid slug e.g. developer-tools`);\n    products = [];\n  } else throw err;\n}","preventionTips":["Validate the category slug against PRODUCTHUNT_CATEGORY_SLUGS before invoking browse.","Copy slugs from the error hint or producthunt.com/categories rather than guessing.","Keep the card selector (a[href^=\"/products/\"] + flex-col) checked after Product Hunt redesigns.","Increase waitForCapture time or retry once when on a slow network to rule out render timeouts."],"tags":["no-data","scraping","invalid-argument","producthunt","dom-extraction"],"backgroundTag":"no-data-found","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}