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

  1. Run a data migration/backfill so all stored resume rows satisfy the current schema.
  2. Inspect error.cause (the Zod error) for the failing path.
  3. For a breaking change, add a transform/default in the schema for backward compatibility.
  4. 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

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


AI-assisted analysis of amruthpillai/reactive-resume@3a5b12e2a4 (2026-08-12). Data as JSON: /api/errors/e41c543a5999b945. Report an issue: GitHub.