{"record":{"id":"9c5c9716f5d06f3b","repo":"saadeghi/daisyui","slug":"timeout-must-be-a-positive-number-of-millisecond-9c5c97","errorCode":null,"errorMessage":"--timeout must be a positive number of milliseconds","messagePattern":"--timeout must be a positive number of milliseconds","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/tailwind-play-share/pr-preview.mjs","lineNumber":70,"sourceCode":"        options.baseSha = takeValue(argv, index, argument)\n        index += 1\n        break\n      case \"--head-sha\":\n        options.headSha = takeValue(argv, index, argument)\n        index += 1\n        break\n      case \"--output\":\n        options.output = takeValue(argv, index, argument)\n        index += 1\n        break\n      case \"--browser\":\n        options.browser = takeValue(argv, index, argument)\n        index += 1\n        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","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/saadeghi/daisyui/blob/42b09e637e09467aa54a813a5aea53c1179aec75/packages/tailwind-play-share/pr-preview.mjs#L52-L88","documentation":"Thrown while parsing --timeout in pr-preview.mjs when the supplied string is not a finite positive number (Number(value) is NaN/Infinity or <= 0). The value must be a positive integer number of milliseconds.","triggerScenarios":"takeValue returns a string like \"abc\", \"\", \"-5\", \"0\", or \"Infinity\"; Number() then yields a non-finite or non-positive result and the guard fires.","commonSituations":"Typing the unit (\"--timeout 45s\"), passing zero/negative, an empty interpolation, or a locale-specific decimal separator.","solutions":["Pass a plain positive integer of milliseconds, e.g. --timeout 60000.","Drop any unit suffix; the flag is milliseconds only.","Omit the flag to accept the 45000ms default."],"exampleFix":"// before\n--timeout 45s\n\n// after\n--timeout 45000","handlingStrategy":"validation","validationCode":"function parseTimeoutMs(raw) {\n  const ms = Number(raw)\n  if (!Number.isFinite(ms) || ms <= 0) {\n    throw new Error(`--timeout must be a positive integer of milliseconds, got: ${raw}`)\n  }\n  return ms\n}","typeGuard":"const isPositiveMillis = (v) => Number.isFinite(Number(v)) && Number(v) > 0","tryCatchPattern":"try {\n  options = parsePreviewArgs(argv)\n} catch (error) {\n  if (error.message.includes(\"--timeout must be a positive number\")) {\n  // re-prompt/fix the timeout value\n  }\n  throw error\n}","preventionTips":["Pass a plain positive integer of milliseconds; never include units.","Validate the timeout string before it reaches the parser.","Omit --timeout to use the 45000ms default."],"tags":["cli","argv","validation","timeout"],"backgroundTag":null,"analyzedSha":"42b09e637e09467aa54a813a5aea53c1179aec75","analyzedAt":"2026-08-13T04:10:09.555Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}