{"record":{"id":"549b6e5ddeaae94b","repo":"angular/angular-cli","slug":"project-projectname-uses-a-custom-karma-confi","errorCode":null,"errorMessage":"Project \"${projectName}\" uses a custom Karma configuration file \"${karmaConfig}\". Tests have been migrated to use Vitest, but you may need to manually migrate custom settings from this Karma config to a Vitest config (e.g. \"vitest-base.config.ts\") and set the \"runnerConfig\" option to true.","messagePattern":"Project \"(.+?)\" uses a custom Karma configuration file \"(.+?)\"\\. Tests have been migrated to use Vitest, but you may need to manually migrate custom settings from this Karma config to a Vitest config \\(e\\.g\\. \"vitest-base\\.config\\.ts\"\\) and set the \"runnerConfig\" option to true\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/schematics/angular/migrations/migrate-karma-to-vitest/karma-processor.ts","lineNumber":163,"sourceCode":"      const diff = await compareKarmaConfigToDefault(\n        analysis,\n        projectName,\n        karmaConfig,\n        needDevkitPlugin,\n      );\n      isRemovable = !hasDifferences(diff) && diff.isReliable;\n    }\n\n    cachedResult = { analysis, isRemovable };\n    cache.set(karmaConfig, cachedResult);\n  }\n\n  if (cachedResult) {\n    extractReporters(cachedResult.analysis, options, projectName, context);\n    extractCoverageSettings(cachedResult.analysis, options, projectName, context);\n\n    if (!cachedResult.isRemovable) {\n      context.logger.warn(\n        `Project \"${projectName}\" uses a custom Karma configuration file \"${karmaConfig}\". ` +\n          `Tests have been migrated to use Vitest, but you may need to manually migrate custom settings ` +\n          `from this Karma config to a Vitest config (e.g. \"vitest-base.config.ts\") ` +\n          `and set the \"runnerConfig\" option to true.`,\n      );\n      manualMigrationFiles.push(karmaConfig);\n    }\n  }\n\n  delete options['karmaConfig'];\n}\n","sourceCodeStart":145,"sourceCodeEnd":175,"githubUrl":"https://github.com/angular/angular-cli/blob/bb72145f9ab45aee29f523236b3a25cd0813a841/packages/schematics/angular/migrations/migrate-karma-to-vitest/karma-processor.ts#L145-L175","documentation":"The Karma-to-Vitest migration can translate the builder options, but when a project points at a custom karma.conf.js that the processor cannot fully remove or translate, it warns that manual migration of custom settings into a Vitest config (e.g. vitest-base.config.ts) is required, and that the 'runnerConfig' option should be set to true.","triggerScenarios":"Running processKarmaConfig during the migrate-karma-to-vitest migration when the project's test target specifies a custom karmaConfig file whose parsed analysis is not flagged as removable (custom plugins, frameworks, middlewares, proxies, etc.).","commonSituations":"Large Angular workspaces with hand-tuned karma.conf.js (webpack customizations, coverage thresholds, custom reporters, proxies) migrating tests to Vitest during an Angular CLI version migration.","solutions":["Review the custom karma.conf.js and port each custom setting (plugins, proxies, middleware, files, preprocessors) into your Vitest config (e.g. vitest-base.config.ts)","Set \"runnerConfig\": true on the test target options so Vitest uses your custom config","Remove the now-unused karma.conf.js once settings are ported","Run your test suite to confirm behavior matches the previous Karma setup"],"exampleFix":"// before (angular.json test target)\n\"karmaConfig\": \"src/karma.conf.js\"\n// after\n\"runnerConfig\": true,\n// plus a vitest-base.config.ts containing the ported custom settings","handlingStrategy":"validation","validationCode":"// before migrating, flag custom karma configs for manual porting\nconst opts = angularJson.projects[proj].architect?.test?.options || {};\nif (opts.karmaConfig) {\n  console.warn(`${proj} uses custom karma config ${opts.karmaConfig}; plan to port settings to a Vitest config and set runnerConfig: true`);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep karma.conf.js minimal; prefer builder options over custom configs","Document any karma plugins/proxies so they are easy to port to Vitest","Set \"runnerConfig\": true only after fully porting custom settings to a Vitest config"],"tags":["angular","schematics","vitest","karma-migration","manual-migration"],"backgroundTag":"karma-config-manual-migration","analyzedSha":"bb72145f9ab45aee29f523236b3a25cd0813a841","analyzedAt":"2026-08-30T02:47:34.745Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}