jackwener/OpenCLI · error · CommandExecutionError

This product requires option selection and is not supported

Error message

This product requires option selection and is not supported in v1.

What it means

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.

Source

Thrown at clis/coupang/add-to-cart.js:134

        const targetUrl = canonicalizeProductUrl(kwargs.url, productId);
        const finalUrl = targetUrl || canonicalizeProductUrl('', productId);
        await page.goto(finalUrl).catch((error) => {
            throw new CommandExecutionError(`coupang add-to-cart navigation failed: ${error?.message || error}`);
        });
        const result = await page.evaluate(buildAddToCartEvaluate(productId)).catch((error) => {
            throw new CommandExecutionError(`coupang add-to-cart evaluation failed: ${error?.message || error}`);
        });
        const loginHints = result?.loginHints ?? {};
        if (loginHints.hasLoginLink && !loginHints.hasMyCoupang) {
            throw new AuthRequiredError('coupang.com', 'Please log into Coupang in Chrome and retry.');
        }
        const actualProductId = normalizeProductId(result?.currentProductId || productId);
        if (result?.reason === 'PRODUCT_MISMATCH') {
            const observed = actualProductId ? `got ${actualProductId}` : 'no product id observed';
            throw new CommandExecutionError(`Product mismatch: expected ${productId}, ${observed}`);
        }
        if (result?.reason === 'OPTION_REQUIRED') {
            throw new CommandExecutionError('This product requires option selection and is not supported in v1.');
        }
        if (result?.reason === 'ADD_TO_CART_BUTTON_NOT_FOUND') {
            throw new CommandExecutionError('Could not find an add-to-cart button on the product page.');
        }
        if (!result?.ok) {
            throw new CommandExecutionError('Failed to confirm add-to-cart success.');
        }
        return [{
                ok: true,
                product_id: actualProductId || productId,
                url: finalUrl,
                message: 'Added to cart',
            }];
    },
});

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Restrict automation to products without options (simple single-variant products)
  2. 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
  3. Skip these products in your pipeline and record them for manual purchase
  4. Check whether the option detection heuristic false-positived (e.g. unrelated select on the page) by inspecting the page manually

Example fix

// before
 await addToCart(page, 'optionProductId')  // throws OPTION_REQUIRED
// after
 const simple = products.filter(p => !p.hasOptions);
 for (const p of simple) await addToCart(page, p.id);
Defensive patterns

Strategy: fallback

Validate before calling

// Fetch the product and skip if it has options
const product = await coupangProduct(productId);
if (product.hasOptions || /옵션|색상|사이즈/.test(JSON.stringify(product))) {
  console.warn(`Skipping ${productId}: requires option selection`);
  return;
}

Type guard

function supportsAutoAddToCart(result) {
  return result != null && result.ok === true && result.reason !== 'OPTION_REQUIRED';
}

Try / catch

try {
  await addToCart(page, productId);
} catch (err) {
  if (/requires option selection/.test(err.message)) {
    skipped.push(productId);  // route to manual purchase queue
    return;
  }
  throw err;
}

Prevention

When it happens

Trigger: 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'.

Common situations: 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.

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/528818d599698a5d. Report an issue: GitHub.