GoogleChrome/lighthouse · error · Error

module '${requirePath}' has too many possible exports

Error message

module '${requirePath}' has too many possible exports

What it means

Error "module '${requirePath}' has too many possible exports" thrown in GoogleChrome/lighthouse.

Source

Thrown at core/config/config-helpers.js:246

    module = await bundledModules.get(requirePath);
  } else if (requirePath.match(/\.(js|mjs|cjs)$/)) {
    module = await import(requirePath);
  } else {
    requirePath += '.js';
    module = await import(requirePath);
  }

  if (module.default) return module.default;

  // Find a valid named export.
  const methods = new Set(['meta']);
  const possibleNamedExports = Object.keys(module).filter(key => {
    if (!(module[key] && module[key] instanceof Object)) return false;
    return Object.getOwnPropertyNames(module[key]).some(method => methods.has(method));
  });
  if (possibleNamedExports.length === 1) return possibleNamedExports[0];
  if (possibleNamedExports.length > 1) {
    throw new Error(`module '${requirePath}' has too many possible exports`);
  }

  throw new Error(`module '${requirePath}' missing default export`);
}

/**
 * @param {string} gathererPath
 * @param {Array<string>} coreGathererList
 * @param {string=} configDir
 * @return {Promise<LH.Config.AnyGathererDefn>}
 */
async function requireGatherer(gathererPath, coreGathererList, configDir) {
  const coreGatherer = coreGathererList.find(a => a === `${gathererPath}.js`);

  let requirePath = `../gather/gatherers/${gathererPath}`;
  if (!coreGatherer) {
    // Otherwise, attempt to find it elsewhere. This throws if not found.
    requirePath = resolveModulePath(gathererPath, configDir, 'gatherer');

View on GitHub (pinned to 9515cd4e58)

Solutions

  1. Export only one class from the module, or add a default export so Lighthouse knows which export to use.
  2. Remove extra named exports that could be confused with the audit/gatherer class.

When it happens

Trigger: Thrown when resolving a plugin or custom module whose exports are ambiguous, so Lighthouse cannot pick the implementation.

Common situations: See trigger scenarios.


AI-assisted analysis of GoogleChrome/lighthouse@9515cd4e58 (2026-08-13). Data as JSON: /api/errors/bdf6de1eca6333b9. Report an issue: GitHub.