amruthpillai/reactive-resume · critical · ORPCError
INTERNAL_SERVER_ERROR
INTERNAL_SERVER_ERROR
Error message
Stored resume data does not match the canonical schema.
What it means
parseStoredResumeData() applies the same canonical Zod schema but to data read from the database, mapping failures to INTERNAL_SERVER_ERROR (500). It signals the persisted JSON no longer conforms — typically a schema migration that didn't transform existing rows, or corruption. The Zod error is in error.cause.
Source
Thrown at packages/api/src/features/resume/resume-data-validation.ts:9
import type { ResumeData } from "@reactive-resume/schema/resume/data";
import { ORPCError } from "@orpc/client";
import { parseResumeData } from "@reactive-resume/schema/resume/data";
function parseApiResumeData(data: unknown, code: "BAD_REQUEST" | "INTERNAL_SERVER_ERROR", message: string): ResumeData {
try {
return parseResumeData(data);
} catch (cause) {
throw new ORPCError(code, {
status: code === "BAD_REQUEST" ? 400 : 500,
message,
cause,
});
}
}
export const parseWritableResumeData = (data: unknown) =>
parseApiResumeData(data, "BAD_REQUEST", "Resume data does not match the canonical schema.");
export const parseStoredResumeData = (data: unknown) =>
parseApiResumeData(data, "INTERNAL_SERVER_ERROR", "Stored resume data does not match the canonical schema.");
View on GitHub (pinned to 3a5b12e2a4)
Solutions
- Run a data migration/backfill so all stored resume rows satisfy the current schema.
- Inspect error.cause (the Zod error) for the failing path.
- For a breaking change, add a transform/default in the schema for backward compatibility.
- For one-off recovery, re-save the resume through the editor to rewrite conforming data.
Defensive patterns
Strategy: try-catch
Validate before calling
import { parseResumeData } from '@reactive-resume/schema/resume/data';
function probeStored(data: unknown) {
const result = parseResumeData.safeParse(data);
if (!result.success) console.warn('Stored data fails schema:', result.error.path);
} Try / catch
try {
await createResumePdfDownload({ id, userId });
} catch (e) {
if (e.code === 'INTERNAL_SERVER_ERROR' && /Stored resume data/.test(e.message)) {
// flag the resume for migration/re-save rather than retrying
} else throw e;
} Prevention
- Ship a data migration alongside every schema change that drops or tightens fields.
- Add backward-compat transforms/defaults in the Zod schema for legacy rows.
- After schema bumps, run a probe over stored rows to find non-conforming data early.
When it happens
Trigger: Reading or exporting a resume whose stored data predates a now-required schema field, contains a removed enum value, or was written by an incompatible older release.
Common situations: Deploying a schema change without a data migration, a failed or partial migration, restoring a DB backup from an older release, or a manual DB edit.
Related errors
- BAD_REQUEST
- An unknown error occurred while validating the merged resume
- INTERNAL_SERVER_ERROR
- INTERNAL_SERVER_ERROR
- JSON.stringify(flattenError(error))
AI-assisted analysis of amruthpillai/reactive-resume@3a5b12e2a4 (2026-08-12).
Data as JSON: /api/errors/e41c543a5999b945.
Report an issue: GitHub.