{"record":{"id":"866d9491f78be65d","repo":"GoogleChrome/lighthouse","slug":"invalid-value-throttling-key-must-be-a-numbe","errorCode":null,"errorMessage":"Invalid value: 'throttling.${key}' must be a number","messagePattern":"Invalid value: 'throttling\\.(.+?)' must be a number","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/cli-flags.js","lineNumber":485,"sourceCode":"    throw new Error(`Invalid value: Argument 'throttling' must be an object, specified per-property ('throttling.rttMs', 'throttling.throughputKbps', etc)`);\n  }\n\n  /** @type {Array<keyof LH.ThrottlingSettings>} */\n  const throttlingKeys = [\n    'rttMs',\n    'throughputKbps',\n    'requestLatencyMs',\n    'downloadThroughputKbps',\n    'uploadThroughputKbps',\n    'cpuSlowdownMultiplier',\n  ];\n\n  /** @type {LH.ThrottlingSettings} */\n  const throttlingSettings = {};\n  for (const key of throttlingKeys) {\n    const possibleSetting = value[key];\n    if (possibleSetting !== undefined && typeof possibleSetting !== 'number') {\n      throw new Error(`Invalid value: 'throttling.${key}' must be a number`);\n    }\n    // Note: this works type-wise because the throttling settings all have the same type.\n    throttlingSettings[key] = possibleSetting;\n  }\n\n  return throttlingSettings;\n}\n\n/**\n * Take yarg's unchecked object value and ensure it is a proper LH.screenEmulationSettings.\n * @param {unknown} value\n * @return {Partial<LH.ScreenEmulationSettings>|undefined}\n */\nfunction coerceScreenEmulation(value) {\n  if (value === undefined) return;\n\n  if (!isObjectOfUnknownValues(value)) {\n    throw new Error(`Invalid value: Argument 'screenEmulation' must be an object, specified per-property ('screenEmulation.width', 'screenEmulation.deviceScaleFactor', etc)`);","sourceCodeStart":467,"sourceCodeEnd":503,"githubUrl":"https://github.com/GoogleChrome/lighthouse/blob/9515cd4e58ebed69f78742d932b501c2cab8ad8f/cli/cli-flags.js#L467-L503","documentation":"After confirming --throttling is an object, coerceThrottling iterates over the six recognized keys (rttMs, throughputKbps, requestLatencyMs, downloadThroughputKbps, uploadThroughputKbps, cpuSlowdownMultiplier). For each key that is present (not undefined), it requires a number type. This error names the specific offending property.","triggerScenarios":"Passing a recognized throttling sub-property with a non-number value. For example: --throttling.rttMs=fast or --throttling.cpuSlowdownMultiplier=high where the value resolves to a string rather than a numeric value.","commonSituations":"Typing a descriptive word instead of a number; shell variable expansion producing a non-numeric string; yargs not coercing the nested value to a number due to quoting; using units like '150ms' instead of bare '150'.","solutions":["Pass bare numeric values without units: --throttling.rttMs=150 (not '150ms')","Ensure shell variables expand to numbers: THROTTLE_RTT=150 && lighthouse --throttling.rttMs=$THROTTLE_RTT","Use a preset to avoid manual throttling values: --preset=mobile or --preset=desktop"],"exampleFix":"# before\nlighthouse --throttling.rttMs=150ms --throttling.cpuSlowdownMultiplier=high https://example.com\n# after\nlighthouse --throttling.rttMs=150 --throttling.cpuSlowdownMultiplier=4 https://example.com","handlingStrategy":"validation","validationCode":"const NUMERIC_THROTTLING_KEYS = ['rttMs','throughputKbps','requestLatencyMs','downloadThroughputKbps','uploadThroughputKbps','cpuSlowdownMultiplier'];\nfunction validateThrottlingValues(value) {\n  for (const key of NUMERIC_THROTTLING_KEYS) {\n    const v = value[key];\n    if (v !== undefined && typeof v !== 'number') {\n      throw new Error(`throttling.${key} must be a number, got ${typeof v}`);\n    }\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pass bare numbers without units: --throttling.rttMs=150 (not '150ms')","Use presets to avoid manual throttling values","When scripting, ensure variables resolve to numbers, not strings"],"tags":["cli","validation","throttling","performance"],"backgroundTag":null,"analyzedSha":"9515cd4e58ebed69f78742d932b501c2cab8ad8f","analyzedAt":"2026-08-13T06:28:10.346Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}