{"record":{"id":"067221f2f1569ecd","repo":"angular/angular-cli","slug":"proxy-configuration-file-proxypath-does-not-exi","errorCode":null,"errorMessage":"Proxy configuration file ${proxyPath} does not exist.","messagePattern":"Proxy configuration file (.+?) does not exist\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/angular_devkit/build_angular/src/tools/webpack/configs/dev-server.ts","lineNumber":166,"sourceCode":"  };\n}\n\n/**\n * Private method to enhance a webpack config with Proxy configuration.\n * @private\n */\nasync function addProxyConfig(\n  root: string,\n  proxyConfig: string | undefined,\n): Promise<object[] | undefined> {\n  if (!proxyConfig) {\n    return undefined;\n  }\n\n  const proxyPath = resolve(root, proxyConfig);\n\n  if (!existsSync(proxyPath)) {\n    throw new Error(`Proxy configuration file ${proxyPath} does not exist.`);\n  }\n\n  let proxyConfiguration;\n\n  switch (extname(proxyPath)) {\n    case '.json': {\n      const content = await fsPromises.readFile(proxyPath, 'utf-8');\n\n      const { parse, printParseErrorCode } = await import('jsonc-parser');\n      const parseErrors: import('jsonc-parser').ParseError[] = [];\n      proxyConfiguration = parse(content, parseErrors, { allowTrailingComma: true });\n\n      if (parseErrors.length > 0) {\n        let errorMessage = `Proxy configuration file ${proxyPath} contains parse errors:`;\n        for (const parseError of parseErrors) {\n          const { line, column } = getJsonErrorLineColumn(parseError.offset, content);\n          errorMessage += `\\n[${line}, ${column}] ${printParseErrorCode(parseError.error)}`;\n        }","sourceCodeStart":148,"sourceCodeEnd":184,"githubUrl":"https://github.com/angular/angular-cli/blob/bb72145f9ab45aee29f523236b3a25cd0813a841/packages/angular_devkit/build_angular/src/tools/webpack/configs/dev-server.ts#L148-L184","documentation":"When serving with a proxy, the dev-server webpack config resolves the `proxyConfig` option against the workspace root and verifies the file exists. This error is thrown when the configured proxy file path does not exist on disk. It fails fast instead of silently serving without proxying.","triggerScenarios":"`ng serve --proxy-config <path>` (or `proxyConfig` in angular.json serve options) where `resolve(root, proxyConfig)` points to a non-existent file — wrong relative path, typo, or file never created.","commonSituations":"Running `ng serve --proxy-config proxy.conf.json` from a different working directory than expected; the file is named `proxy.conf.js` vs `.json`; path written relative to the project dir instead of workspace root (or vice versa in monorepos); fresh clone where the proxy file is gitignored.","solutions":["Create the proxy config file at the exact path given (e.g. `proxy.conf.json` at the workspace root).","Fix the path in the command or angular.json `serve.options.proxyConfig` — remember it resolves relative to the workspace root.","In monorepos, use a path relative to the workspace root like `projects/app/proxy.conf.json`.","Verify the file exists with `ls <resolved-path>` from the directory where `ng serve` runs."],"exampleFix":"// before (file missing)\nng serve --proxy-config ./src/proxy.config.json\n// after (file exists at workspace root)\nng serve --proxy-config proxy.conf.json","handlingStrategy":"validation","validationCode":"import * as fs from 'fs';\nimport * as path from 'path';\nconst proxyPath = path.resolve(workspaceRoot, 'proxy.conf.json');\nif (!fs.existsSync(proxyPath)) {\n  throw new Error(`Create proxy config at ${proxyPath} before running ng serve`);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Commit proxy.conf.json to the repo (don't gitignore it).","Remember proxyConfig resolves relative to the workspace root, not the project dir.","Keep the CLI flag path and the angular.json option path in sync."],"tags":["angular","dev-server","proxy","missing-file","configuration"],"backgroundTag":"config-file-not-found","analyzedSha":"bb72145f9ab45aee29f523236b3a25cd0813a841","analyzedAt":"2026-08-30T02:47:34.745Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}