{"record":{"id":"920bb987a7c7c41b","repo":"cypress-io/cypress","slug":"could-not-find-angular-json-looked-in-projectro","errorCode":null,"errorMessage":"Could not find angular.json. Looked in ${projectRoot} and up.","messagePattern":"Could not find angular\\.json\\. Looked in (.+?) and up\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"npm/webpack-dev-server/src/helpers/angularHandler.ts","lineNumber":226,"sourceCode":"    generateBrowserWebpackConfigFromContext,\n    getCommonConfig,\n    getStylesConfig,\n    logging,\n  }\n}\n\nexport async function getAngularJson (projectRoot: string): Promise<AngularJson> {\n  // NOTE: @cypress/webpack-dev-server is a CJS package, but find-up +6.0.0 is an ESM only package.\n  // In order to dynamically import the find-up package, we need to use tsx to do so until @cypress/webpack-dev-server is an ESM-only package,\n  // which would be a breaking change to @cypress/webpack-dev-server and cypress.\n  const { tsImport } = require('tsx/esm/api')\n\n  const { findUp } = await tsImport('find-up', __filename) as typeof import('find-up')\n\n  const angularJsonPath = await findUp('angular.json', { cwd: projectRoot })\n\n  if (!angularJsonPath) {\n    throw new Error(`Could not find angular.json. Looked in ${projectRoot} and up.`)\n  }\n\n  const angularJson = await fs.readFile(angularJsonPath, 'utf8')\n\n  return JSON.parse(angularJson)\n}\n\nfunction createFakeContext (projectRoot: string, defaultProjectConfig: Cypress.AngularDevServerProjectConfig, logging: typeof AngularLogging) {\n  const logger = new logging.Logger(debugPrefix)\n\n  // Proxy all logging calls through to the debug logger\n  logger.forEach((value: AngularLogging.LogEntry) => {\n    debug(JSON.stringify(value))\n  })\n\n  const context = {\n    target: {\n      project: 'angular',","sourceCodeStart":208,"sourceCodeEnd":244,"githubUrl":"https://github.com/cypress-io/cypress/blob/0d85fdc91230885bca0a91df278312800a48b727/npm/webpack-dev-server/src/helpers/angularHandler.ts#L208-L244","documentation":"Thrown by getAngularJson after find-up walks the directory tree starting at projectRoot and fails to locate a file named angular.json. The lookup uses tsImport('find-up') because find-up 6+ is ESM-only and this package is CJS. This is a project-detection error: Cypress believes it is in an Angular project (e.g. because the Angular framework handler was selected) but cannot find the manifest that defines the project.","triggerScenarios":"Invoking the Angular webpack-dev-server handler with a projectRoot that points at a sub-directory of an Angular workspace (e.g. a project that lives under apps/my-app) where angular.json sits several levels above and find-up's recursion was constrained, or invoking the Angular handler on a non-Angular project.","commonSituations":"Wrong `componentFolder` / projectRoot configured in cypress.config.ts, running Cypress from a deeply nested package whose angular.json is outside the search ceiling, monorepo where angular.json was renamed (e.g. workspace.json in Nx), or the devServer was misconfigured to use the Angular handler for a React/Vue project.","solutions":["Confirm angular.json exists at the Angular workspace root and run `cypress open`/`cypress run` from that root.","Set the correct projectRoot / componentFolder in cypress.config.ts so it resolves up to the directory containing angular.json.","If using Nx with angular.json renamed or relocated, regenerate it (`ng update` or restore the workspace.json -> angular.json mapping).","Switch the devServer framework away from Angular if you are not actually testing an Angular app."],"exampleFix":"// before (cypress.config.ts)\nexport default defineConfig({\n  component: {\n    devServer: { framework: 'angular' },\n    componentFolder: './libs/some-lib',\n  },\n})\n// after\nexport default defineConfig({\n  component: {\n    devServer: { framework: 'angular' },\n    componentFolder: './apps/my-app/src/app',\n    // projectRoot should resolve upward to the folder containing angular.json\n  },\n})","handlingStrategy":"validation","validationCode":"import { existsSync } from 'fs'\nimport { resolve } from 'path'\n\nfunction findAngularJsonUp (dir: string): string | null {\n  let cur = dir\n  for (let i = 0; i < 10 && cur !== '/'; i++) {\n    if (existsSync(resolve(cur, 'angular.json'))) return resolve(cur, 'angular.json')\n    cur = resolve(cur, '..')\n  }\n  return null\n}","typeGuard":"function hasAngularJsonInTree (projectRoot: string): boolean {\n  return findAngularJsonUp(projectRoot) !== null\n}","tryCatchPattern":null,"preventionTips":["Run Cypress from the Angular workspace root.","Verify angular.json exists before invoking the Angular dev server.","Confirm Nx workspace.json/angular.json mapping is intact."],"tags":["angular","file-resolution","configuration","dev-server"],"backgroundTag":null,"analyzedSha":"0d85fdc91230885bca0a91df278312800a48b727","analyzedAt":"2026-08-12T16:24:28.056Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}