{"record":{"id":"ca0f3beaf3bbcf87","repo":"heygen-com/hyperframes","slug":"grades-file-not-found-filepath","errorCode":null,"errorMessage":"Grades file not found: ${filePath}","messagePattern":"Grades file not found: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cli/src/commands/grade-compare.ts","lineNumber":210,"sourceCode":"function rewriteGradingLutSrc(grading: unknown, src: string): unknown {\n  if (!isRecord(grading) || !hasOwn(grading, \"lut\")) return grading;\n  const lut = grading.lut;\n  const next = cloneRecord(grading);\n  if (typeof lut === \"string\") {\n    next.lut = { src };\n    return next;\n  }\n  if (isRecord(lut)) {\n    const nextLut = cloneRecord(lut);\n    nextLut.src = src;\n    next.lut = nextLut;\n  }\n  return next;\n}\n\nexport function parseGradesFile(filePath: string): GradeCompareCell[] {\n  if (!existsSync(filePath)) {\n    throw new Error(`Grades file not found: ${filePath}`);\n  }\n\n  let parsed: unknown;\n  try {\n    parsed = JSON.parse(readFileSync(filePath, \"utf-8\"));\n  } catch (err) {\n    throw new Error(`Could not parse grades JSON: ${normalizeErrorMessage(err)}`);\n  }\n\n  if (!Array.isArray(parsed)) {\n    throw new Error(\"Grades file must be a JSON array of { label, grading } objects\");\n  }\n\n  return parsed.map((entry, index) => {\n    if (!isRecord(entry)) {\n      throw new Error(`Grade entry ${index + 1} must be an object with label and grading`);\n    }\n    const label = entry.label;","sourceCodeStart":192,"sourceCodeEnd":228,"githubUrl":"https://github.com/heygen-com/hyperframes/blob/c2996c8626135db5253519359d8a063d3bafad8d/packages/cli/src/commands/grade-compare.ts#L192-L228","documentation":"Thrown by parseGradesFile() as its first check: existsSync(filePath) must be true. The filePath is already resolved against projectDir by parseGradeCompareArgs before this function is called, so the message shows the absolute path that was searched.","triggerScenarios":"`--grades missing.json`; a relative path resolved against a --project dir where the file does not exist; a typo; case mismatch on a case-sensitive filesystem; the path points at a directory instead of a file.","commonSituations":"Running the command from a different cwd than expected; using a path relative to the shell cwd while --project points elsewhere; copying a path from another machine with a different layout.","solutions":["Pass an absolute path, or one relative to --project (the resolution base)","Verify with `ls <path>` from the same directory you pass as --project","Check spelling and case exactly"],"exampleFix":"// before (wrong base / typo)\nhyperframes grade-compare --for f.png --grades grades.json --project ./reels\n// after (absolute, or correct relative path)\nhyperframes grade-compare --for f.png --grades /abs/reels/grades.json --project ./reels","handlingStrategy":"validation","validationCode":"import { existsSync } from 'node:fs';\nif (!existsSync(filePath)) {\n  throw new Error(`grades file not found: ${filePath}`);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pass --grades as an absolute path or relative to --project (the resolution base)","Verify the path with ls from the same --project directory before running","Double-check case on case-sensitive filesystems"],"tags":["grade-compare","validation","file-not-found","fs"],"backgroundTag":null,"analyzedSha":"c2996c8626135db5253519359d8a063d3bafad8d","analyzedAt":"2026-08-12T22:18:56.877Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}