{"record":{"id":"4f05f24cfa724bcc","repo":"GoogleChrome/lighthouse","slug":"expected-array-but-got-typeof-base","errorCode":null,"errorMessage":"Expected array but got ${typeof base}","messagePattern":"Expected array but got (.+?)","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"core/config/config-helpers.js","lineNumber":90,"sourceCode":" *        - false: Arrays are concatenated and de-duped by isEqual.\n *    - Objects are recursively merged.\n *    - If the `settings` key is encountered while traversing an object, its arrays are *always*\n *      overridden, not concatenated. (`overwriteArrays` is flipped to `true`)\n *\n * More widely typed than exposed merge() function, below.\n * @param {Object<string, any>|Array<any>|undefined|null} base\n * @param {Object<string, any>|Array<any>} extension\n * @param {boolean=} overwriteArrays\n */\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;","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/GoogleChrome/lighthouse/blob/9515cd4e58ebed69f78742d932b501c2cab8ad8f/core/config/config-helpers.js#L72-L108","documentation":"Error \"Expected array but got ${typeof base}\" thrown in GoogleChrome/lighthouse.","triggerScenarios":"Thrown during config extension when a base config value that must be merged as an array (e.g. audits or categories) is not an array.","commonSituations":"See trigger scenarios.","solutions":["Pass an array for this config property instead of the current value.","Check the type of the value you supplied; use JSON array syntax, e.g. [\"value1\", \"value2\"]."],"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"}