{"record":{"id":"08e124992e1dd411","repo":"axios/axios","slug":"err-bad-option-08e124","errorCode":"ERR_BAD_OPTION","errorMessage":"Unknown option ' + opt","messagePattern":"Unknown option ' \\+ opt","errorType":"exception","errorClass":"AxiosError","httpStatus":null,"severity":"warning","filePath":"lib/helpers/validator.js","lineNumber":104,"sourceCode":"  let i = keys.length;\n  while (i-- > 0) {\n    const opt = keys[i];\n    // Use hasOwnProperty so a polluted Object.prototype.<opt> cannot supply\n    // a non-function validator and cause a TypeError.\n    const validator = Object.prototype.hasOwnProperty.call(schema, opt) ? schema[opt] : undefined;\n    if (validator) {\n      const value = options[opt];\n      const result = value === undefined || validator(value, opt, options);\n      if (result !== true) {\n        throw new AxiosError(\n          'option ' + opt + ' must be ' + result,\n          AxiosError.ERR_BAD_OPTION_VALUE\n        );\n      }\n      continue;\n    }\n    if (allowUnknown !== true) {\n      throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);\n    }\n  }\n}\n\nexport default {\n  assertOptions,\n  validators,\n};\n","sourceCodeStart":86,"sourceCodeEnd":113,"githubUrl":"https://github.com/axios/axios/blob/e0a02dd16671deabe2b809334d4c2ebede29a233/lib/helpers/validator.js#L86-L113","documentation":"Thrown by assertOptions() when an option key is absent from the schema AND allowUnknown !== true. Axios.js calls assertOptions(transitional, schema, false) — allowUnknown is false for transitional — so any unrecognized transitional key throws ERR_BAD_OPTION. By contrast, paramsSerializer and the spelling check pass allowUnknown=true, so unknowns are permitted there. This catches typos and retired-but-not-removed keys in the transitional object.","triggerScenarios":"axios.get('/url', { transitional: { jsonParsing: true } }) (typo; should be silentJSONParsing); { transitional: { enforceSSL: true } } (nonexistent). Any key not among silentJSONParsing, forcedJSONParsing, clarifyTimeoutError, legacyInterceptorReqResOrdering, advertiseZstdAcceptEncoding, validateStatusUndefinedResolves triggers the throw.","commonSituations":"Typos in transitional option names; carrying options from old axios versions that were removed without a transitional false marker; IDE autocomplete mistakes; config shared across axios versions where keys were renamed.","solutions":["Remove the unknown key, or correct its spelling to match the documented transitional schema.","Compare your transitional keys against the allowed set for the current axios version.","Move the setting to its correct location — some options belong at the top-level config, not under transitional."],"exampleFix":"// before\naxios.get('/url', { transitional: { jsonParsing: true } });\n\n// after\naxios.get('/url', { transitional: { silentJSONParsing: true } });","handlingStrategy":"validation","validationCode":"const ALLOWED_TRANSITIONAL = new Set(['silentJSONParsing','forcedJSONParsing','clarifyTimeoutError','legacyInterceptorReqResOrdering','advertiseZstdAcceptEncoding','validateStatusUndefinedResolves']);\nconst t = config.transitional || {};\nObject.keys(t).forEach(k => { if (!ALLOWED_TRANSITIONAL.has(k)) delete t[k]; });","typeGuard":"const ALLOWED_TRANSITIONAL = new Set(['silentJSONParsing','forcedJSONParsing','clarifyTimeoutError','legacyInterceptorReqResOrdering','advertiseZstdAcceptEncoding','validateStatusUndefinedResolves']);\nconst isKnownTransitional = (o) => Object.keys(o || {}).every(k => ALLOWED_TRANSITIONAL.has(k));","tryCatchPattern":null,"preventionTips":["Cross-check transitional keys against the current axios schema; remove unknowns.","Use IDE autocomplete or TypeScript types to avoid spelling mistakes.","Re-read the transitional options list after each axios upgrade in case keys were renamed."],"tags":["config","validation","typo","bad-option","transitional"],"backgroundTag":null,"analyzedSha":"e0a02dd16671deabe2b809334d4c2ebede29a233","analyzedAt":"2026-08-11T15:10:15.830Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}