{"record":{"id":"268d96ec1dae8034","repo":"remix-run/remix","slug":"doctor-fix-path-resolves-outside-the-app-root-f","errorCode":null,"errorMessage":"Doctor fix path resolves outside the app root: ${fixPath}","messagePattern":"Doctor fix path resolves outside the app root: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cli/src/lib/doctor/fixes.ts","lineNumber":132,"sourceCode":"    if (isErrorWithCode(error, 'ENOENT')) {\n      return null\n    }\n\n    throw error\n  }\n}\n\nfunction isPathInsideRoot(rootPath: string, filePath: string): boolean {\n  let relativePath = path.relative(rootPath, filePath)\n  return relativePath === '' || (!relativePath.startsWith('..') && !path.isAbsolute(relativePath))\n}\n\nfunction isErrorWithCode(error: unknown, code: string): boolean {\n  return typeof error === 'object' && error !== null && 'code' in error && error.code === code\n}\n\nfunction throwDoctorFixPathOutsideRoot(fixPath: string): never {\n  throw new Error(`Doctor fix path resolves outside the app root: ${fixPath}`)\n}\n","sourceCodeStart":114,"sourceCodeEnd":134,"githubUrl":"https://github.com/remix-run/remix/blob/9696913134be3a4423513d2775f7b31d6917c049/packages/cli/src/lib/doctor/fixes.ts#L114-L134","documentation":"Doctor applies automated fixes only to files inside the app root; this error fires when a fix path, after resolution, lands outside that root. It is a safety guard for the `remix doctor` repair steps.","triggerScenarios":"resolveDoctorFixPath encountering a fixPath (from a doctor fix definition or resolved relative to the app) that normalizes to a location outside the app root directory.","commonSituations":"Running `remix doctor --fix` in a monorepo where the detected app root is wrong (run from package subdirectory), or a fix target computed via '../../' style paths; stale or moved project layout.","solutions":["Re-run `remix doctor` from the actual app root directory (where remix.json lives)","Verify remix.json exists in the expected package so app-root detection succeeds","If the fix legitimately targets a shared file, move or configure the app root to include it"],"exampleFix":"# before\npackages/app/subdir $ remix doctor --fix\n# after\npackages/app $ remix doctor --fix","handlingStrategy":"validation","validationCode":"let resolved = path.resolve(appRoot, fixPath)\nif (!resolved.startsWith(path.resolve(appRoot) + path.sep)) {\n  // re-run doctor from the correct app root instead\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run remix doctor from the directory containing remix.json","Keep fix targets relative to the app root","Avoid nested symlink layouts that confuse app-root detection"],"tags":["cli","doctor","path-traversal","app-root"],"backgroundTag":"path-outside-project-root","analyzedSha":"9696913134be3a4423513d2775f7b31d6917c049","analyzedAt":"2026-08-27T19:55:01.024Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}