angular/angular-cli · warning

Project "${projectName}" uses a custom Karma reporter "${r}"

Error message

Project "${projectName}" uses a custom Karma reporter "${r}". This reporter cannot be automatically mapped to Vitest. Please check the Vitest documentation for equivalent reporters.

What it means

Warning from extractReporters in karma-processor.ts. During the Karma-to-Vitest migration, each string reporter in karma.conf.js is checked against SUPPORTED_REPORTERS. A string reporter that is neither 'progress', 'kjhtml', nor in the supported set is a custom Karma reporter that cannot be auto-mapped, so it is skipped with this warning.

Source

Thrown at packages/schematics/angular/migrations/migrate-karma-to-vitest/karma-processor.ts:38

): void {
  const reporters = analysis.settings.get('reporters');
  if (Array.isArray(reporters)) {
    const mappedReporters: string[] = [];
    for (const r of reporters) {
      if (typeof r === 'string') {
        if (r === 'progress') {
          mappedReporters.push('default');
        } else if (r === 'kjhtml') {
          context.logger.warn(
            `Project "${projectName}" uses the "kjhtml" reporter. ` +
              `This has not been automatically mapped. ` +
              `For an interactive test UI in Vitest, consider setting the "ui" option to true in your test target options ` +
              `and installing "@vitest/ui".`,
          );
        } else if (SUPPORTED_REPORTERS.has(r)) {
          mappedReporters.push(r);
        } else {
          context.logger.warn(
            `Project "${projectName}" uses a custom Karma reporter "${r}". ` +
              `This reporter cannot be automatically mapped to Vitest. ` +
              `Please check the Vitest documentation for equivalent reporters.`,
          );
        }
      } else {
        context.logger.warn(
          `Project "${projectName}" has a non-string reporter in Karma config. ` +
            `This cannot be automatically mapped to Vitest.`,
        );
      }
    }
    if (mappedReporters.length > 0) {
      options['reporters'] = [...new Set(mappedReporters)];
    }
  }
}

View on GitHub (pinned to bb72145f9a)

Solutions

  1. Find a Vitest equivalent reporter/plugin and add it to the generated vitest config manually (e.g. @vitest/coverage-v8, vitest junit reporter).
  2. Remove the custom reporter from karma.conf.js before migrating if it is no longer needed.
  3. Consult the Vitest documentation for equivalent reporters and configure them post-migration.
  4. Keep coverage via Vitest's built-in coverage config instead of karma-coverage* plugins.

Example fix

// before (karma.conf.js)
reporters: ['progress', 'coverage-istanbul'],
// after (vitest config)
test: { reporters: ['default'], coverage: { provider: 'v8', enabled: true } }
Defensive patterns

Strategy: validation

Validate before calling

const SUPPORTED = new Set(['progress', 'kjhtml', 'dots', ...]);
const reporters: string[] = karmaConfig?.reporters ?? [];
const unsupported = reporters.filter(r => !SUPPORTED.has(r) && r !== 'progress');
if (unsupported.length) console.warn('reporters need manual Vitest mapping:', unsupported);

Type guard

function hasCustomReporters(reporters: unknown): reporters is string[] {
  return Array.isArray(reporters) && reporters.some(r => typeof r === 'string' && !SUPPORTED_REPORTERS.has(r));
}

Prevention

When it happens

Trigger: Running the migrate-karma-to-vitest migration on a karma.conf.js whose `reporters` array contains an unsupported custom string (e.g. 'coverage-istanbul', 'mocha', 'junit', or a plugin-provided reporter name).

Common situations: Projects using karma-coverage-istanbul or karma-junit-reporter for CI; third-party or in-house Karma reporter plugins; teams with specialized reporting setups.

Related errors


AI-assisted analysis of angular/angular-cli@bb72145f9a (2026-08-30). Data as JSON: /api/errors/bdd87941d38cc70d. Report an issue: GitHub.