{"record":{"id":"528818d599698a5d","repo":"jackwener/OpenCLI","slug":"this-product-requires-option-selection-and-is-not","errorCode":null,"errorMessage":"This product requires option selection and is not supported in v1.","messagePattern":"This product requires option selection and is not supported in v1\\.","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/coupang/add-to-cart.js","lineNumber":134,"sourceCode":"        const targetUrl = canonicalizeProductUrl(kwargs.url, productId);\n        const finalUrl = targetUrl || canonicalizeProductUrl('', productId);\n        await page.goto(finalUrl).catch((error) => {\n            throw new CommandExecutionError(`coupang add-to-cart navigation failed: ${error?.message || error}`);\n        });\n        const result = await page.evaluate(buildAddToCartEvaluate(productId)).catch((error) => {\n            throw new CommandExecutionError(`coupang add-to-cart evaluation failed: ${error?.message || error}`);\n        });\n        const loginHints = result?.loginHints ?? {};\n        if (loginHints.hasLoginLink && !loginHints.hasMyCoupang) {\n            throw new AuthRequiredError('coupang.com', 'Please log into Coupang in Chrome and retry.');\n        }\n        const actualProductId = normalizeProductId(result?.currentProductId || productId);\n        if (result?.reason === 'PRODUCT_MISMATCH') {\n            const observed = actualProductId ? `got ${actualProductId}` : 'no product id observed';\n            throw new CommandExecutionError(`Product mismatch: expected ${productId}, ${observed}`);\n        }\n        if (result?.reason === 'OPTION_REQUIRED') {\n            throw new CommandExecutionError('This product requires option selection and is not supported in v1.');\n        }\n        if (result?.reason === 'ADD_TO_CART_BUTTON_NOT_FOUND') {\n            throw new CommandExecutionError('Could not find an add-to-cart button on the product page.');\n        }\n        if (!result?.ok) {\n            throw new CommandExecutionError('Failed to confirm add-to-cart success.');\n        }\n        return [{\n                ok: true,\n                product_id: actualProductId || productId,\n                url: finalUrl,\n                message: 'Added to cart',\n            }];\n    },\n});\n","sourceCodeStart":116,"sourceCodeEnd":150,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/coupang/add-to-cart.js#L116-L150","documentation":"CommandExecutionError thrown when the page evaluation detects option-selection UI (a select/listbox or option-labelled element matching 옵션/색상/사이즈/용량/선택). This CLI version intentionally does not support products requiring options, so it aborts instead of guessing a variant.","triggerScenarios":"Running add-to-cart on any Coupang product page whose DOM contains option selectors (e.g. clothing with size/color, items with capacity choices) — the in-page probe returns reason 'OPTION_REQUIRED'.","commonSituations":"Apparel, electronics with configuration variants, or rocket-growth products; automating add-to-cart for a catalog that includes option products; Coupang A/B tests introducing an option widget even on previously simple products.","solutions":["Restrict automation to products without options (simple single-variant products)","If an option product is required, add explicit option-selection logic (select the variant) before invoking add-to-cart — a newer CLI version may support this","Skip these products in your pipeline and record them for manual purchase","Check whether the option detection heuristic false-positived (e.g. unrelated select on the page) by inspecting the page manually"],"exampleFix":"// before\n await addToCart(page, 'optionProductId')  // throws OPTION_REQUIRED\n// after\n const simple = products.filter(p => !p.hasOptions);\n for (const p of simple) await addToCart(page, p.id);","handlingStrategy":"fallback","validationCode":"// Fetch the product and skip if it has options\nconst product = await coupangProduct(productId);\nif (product.hasOptions || /옵션|색상|사이즈/.test(JSON.stringify(product))) {\n  console.warn(`Skipping ${productId}: requires option selection`);\n  return;\n}","typeGuard":"function supportsAutoAddToCart(result) {\n  return result != null && result.ok === true && result.reason !== 'OPTION_REQUIRED';\n}","tryCatchPattern":"try {\n  await addToCart(page, productId);\n} catch (err) {\n  if (/requires option selection/.test(err.message)) {\n    skipped.push(productId);  // route to manual purchase queue\n    return;\n  }\n  throw err;\n}","preventionTips":["Curate product lists to exclude option/variant products","Pre-check product pages for option selectors before automating","Keep a manual-purchase fallback queue for option products"],"tags":["coupang","unsupported-feature","options"],"backgroundTag":"option-selection-required","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}