{"record":{"id":"0e7d0afdf97d8a94","repo":"saadeghi/daisyui","slug":"unknown-option-argument-0e7d0a","errorCode":null,"errorMessage":"Unknown option: ${argument}","messagePattern":"Unknown option: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/tailwind-play-share/pr-preview.mjs","lineNumber":84,"sourceCode":"        break\n      case \"--timeout\": {\n        const timeoutMs = Number(takeValue(argv, index, argument))\n        if (!Number.isFinite(timeoutMs) || timeoutMs <= 0) {\n          throw new Error(\"--timeout must be a positive number of milliseconds\")\n        }\n        options.timeoutMs = timeoutMs\n        index += 1\n        break\n      }\n      case \"--verbose\":\n        options.verbose = true\n        break\n      case \"--help\":\n      case \"-h\":\n        options.help = true\n        break\n      default:\n        throw new Error(`Unknown option: ${argument}`)\n    }\n  }\n\n  return options\n}\n\nfunction git(args) {\n  try {\n    return execFileSync(\"git\", args, {\n      cwd: repositoryRoot,\n      encoding: \"utf8\",\n      maxBuffer: 32 * 1024 * 1024,\n      stdio: [\"ignore\", \"pipe\", \"pipe\"],\n    })\n  } catch (error) {\n    const details = error.stderr?.trim() || error.message\n    throw new Error(`git ${args[0]} failed: ${details}`)\n  }","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/saadeghi/daisyui/blob/42b09e637e09467aa54a813a5aea53c1179aec75/packages/tailwind-play-share/pr-preview.mjs#L66-L102","documentation":"Thrown by the default branch of the option-parsing switch in parsePreviewArgs when an argument starts with an unrecognized flag. Unlike index.mjs, pr-preview.mjs treats any unrecognized token as an error rather than a positional.","triggerScenarios":"Passing a flag the parser does not know (e.g. --html, --css, --headed, --sha, -v) to pr-preview.mjs.","commonSituations":"Confusing pr-preview.mjs options with index.mjs options, a typo in a flag name, or passing --help-style flags that do not exist for this entry point.","solutions":["Run `--help` to list the accepted flags for pr-preview.mjs.","Remove or correct the unknown flag.","Use index.mjs (not pr-preview.mjs) for HTML/CSS input flags."],"exampleFix":"// before\nbun packages/tailwind-play-share/pr-preview.mjs --html '<div/>' --base-sha a --head-sha b --output o.json\n\n// after\nbun packages/tailwind-play-share/index.mjs --html '<div/>' --css ''","handlingStrategy":"validation","validationCode":"const KNOWN_FLAGS = new Set([\"--base-sha\", \"--head-sha\", \"--output\", \"--browser\", \"--timeout\", \"--verbose\", \"--help\", \"-h\"])\nfunction onlyKnownFlags(argv) {\n  for (const a of argv) if (a.startsWith(\"-\") && !KNOWN_FLAGS.has(a)) throw new Error(`Unknown option: ${a}`)\n}","typeGuard":null,"tryCatchPattern":"try {\n  options = parsePreviewArgs(argv)\n} catch (error) {\n  if (error.message.startsWith(\"Unknown option:\")) {\n  // show --help and correct the flag\n  }\n  throw error\n}","preventionTips":["Run --help to confirm accepted flags before scripting the invocation.","Use index.mjs for HTML/CSS input; pr-preview.mjs only takes preview flags.","Validate flags against a known set in CI wrappers."],"tags":["cli","argv","argument-parsing"],"backgroundTag":null,"analyzedSha":"42b09e637e09467aa54a813a5aea53c1179aec75","analyzedAt":"2026-08-13T04:10:09.555Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}