{"record":{"id":"6f83de4ad90eacdf","repo":"GoogleChrome/lighthouse","slug":"expected-object-but-got-array","errorCode":null,"errorMessage":"Expected object but got Array","messagePattern":"Expected object but got Array","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"core/config/config-helpers.js","lineNumber":99,"sourceCode":" */\nfunction _mergeConfigFragment(base, extension, overwriteArrays = false) {\n  // If the default value doesn't exist or is explicitly null, defer to the extending value\n  if (typeof base === 'undefined' || base === null) {\n    return extension;\n  } else if (typeof extension === 'undefined') {\n    return base;\n  } else if (Array.isArray(extension)) {\n    if (overwriteArrays) return extension;\n    if (!Array.isArray(base)) throw new TypeError(`Expected array but got ${typeof base}`);\n    const merged = base.slice();\n    extension.forEach(item => {\n      if (!merged.some(candidate => isEqual(candidate, item))) merged.push(item);\n    });\n\n    return merged;\n  } else if (typeof extension === 'object') {\n    if (typeof base !== 'object') throw new TypeError(`Expected object but got ${typeof base}`);\n    if (Array.isArray(base)) throw new TypeError('Expected object but got Array');\n    Object.keys(extension).forEach(key => {\n      const localOverwriteArrays = overwriteArrays ||\n        (key === 'settings' && typeof base[key] === 'object');\n      base[key] = _mergeConfigFragment(base[key], extension[key], localOverwriteArrays);\n    });\n    return base;\n  }\n\n  return extension;\n}\n\n/**\n * Until support of jsdoc templates with constraints, type in config.d.ts.\n * See https://github.com/Microsoft/TypeScript/issues/24283\n * @type {LH.Config.Merge}\n */\nconst mergeConfigFragment = _mergeConfigFragment;\n","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/GoogleChrome/lighthouse/blob/9515cd4e58ebed69f78742d932b501c2cab8ad8f/core/config/config-helpers.js#L81-L117","documentation":"Error \"Expected object but got Array\" thrown in GoogleChrome/lighthouse.","triggerScenarios":"Thrown during config extension when a base config value that must be an object is given as an Array.","commonSituations":"See trigger scenarios.","solutions":["Pass a plain object instead of an array for this config property.","Convert the array into an object with named keys."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9515cd4e58ebed69f78742d932b501c2cab8ad8f","analyzedAt":"2026-08-13T06:28:10.346Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}