amruthpillai/reactive-resume · error · Error

No data was returned from the AI provider.

Error message

No data was returned from the AI provider.

What it means

Thrown after all import branches when the local `data` variable is still falsy. Per the inline comment this covers the case where the AI import endpoint returns no parsed resume data — i.e. client.ai.parsePdf/parseDocx resolved to undefined/null/empty. It also fires defensively if no type branch matched (though the form schema and the early return at line 141 normally prevent that). The thrown Error carries an i18n message comment ('Error shown when AI import endpoint returns no parsed resume data') and is shown as a toast.

Source

Thrown at apps/web/src/dialogs/resume/import.tsx:195

					if (isLoadingAiProviders) throw new Error(t`Loading AI providers. Please try again in a moment.`);
					if (!hasUsableProvider)
						throw new Error(t`This feature requires a connected AI provider. Please set one up in the settings.`);

					const base64 = await fileToBase64(value.file);

					const mediaType =
						value.file.type === "application/msword"
							? ("application/msword" as const)
							: ("application/vnd.openxmlformats-officedocument.wordprocessingml.document" as const);

					data = await client.ai.parseDocx({
						mediaType,
						file: { name: value.file.name, data: base64 },
					});
				}

				if (!data) {
					throw new Error(
						t({
							comment: "Error shown when AI import endpoint returns no parsed resume data",
							message: "No data was returned from the AI provider.",
						}),
					);
				}

				const id = await importResume({ data });
				toast.success(t`Your resume has been imported successfully.`, { id: toastId, description: null });
				closeDialog();
				void navigate({ to: "/builder/$resumeId", params: { resumeId: id } });
			} catch (error: unknown) {
				toast.error(
					getOrpcErrorMessage(error, {
						byCode: {
							BAD_REQUEST: t({
								comment: "Error shown when AI parsing returns invalid resume structure during import",
								message: "The imported file could not be parsed into a valid resume.",

View on GitHub (pinned to 3a5b12e2a4)

Solutions

  1. Retry with a different file — the file may be image-only/scanned; use a text-based PDF or a DOCX with selectable text.
  2. Switch to a more capable AI provider/model in Settings → Integrations and ensure its connection test passes.
  3. Check server logs for the ai.parsePdf/parseDocx handler to see why it returned an empty payload (model error, truncated response, schema rejection).
  4. If importing a JSON-based format, confirm the detected type matched (the Combobox) — a misdetected type can route to the wrong branch. As a workaround, manually pick 'JSON Resume' or 'Reactive Resume (JSON)'.

Example fix

// before: scanned/image-only PDF -> AI returns no structured data
const data = await client.ai.parsePdf({ file: { name, data: base64 } });
// data is undefined -> toast: 'No data was returned from the AI provider.'

// after: use a text-based source or a stronger model
// 1. Re-export the resume to a text PDF / DOCX with selectable text, or
// 2. Switch to an OCR-capable / stronger provider in Integrations, then retry.
Defensive patterns

Strategy: try-catch

Validate before calling

// validate the file has extractable text before sending to AI
async function hasSelectableText(file: File): Promise<boolean> {
  if (file.type === 'application/pdf') {
    // heuristic: very small text layer -> likely scanned
    return file.size > 0; // full text-check needs a PDF lib; at minimum warn on tiny files
  }
  return true;
}
if (!(await hasSelectableText(file))) {
  warnUser('This file looks scanned; AI may return no data.');
}

Type guard

function hasAiData<T>(data: T | undefined | null): data is T {
  return data != null;
}

Try / catch

let data = await client.ai.parsePdf({ file });
if (!data) {
  // show actionable message: try a text-based file or a different provider
  toast.error('No data returned. Try a text-based PDF or switch AI provider.');
  return;
}

Prevention

When it happens

Trigger: client.ai.parsePdf or client.ai.parseDocx resolves but returns undefined/null (the oRPC handler returned no payload). The AI provider responded but the server could not extract a valid resume structure and returned an empty result without throwing. A discriminated-union type mismatch where value.type doesn't match any branch (defensive fallback).

Common situations: The AI provider returned an empty or unparseable response (e.g. the PDF is image-only/scanned with no OCR-capable model). The server-side parser dropped the result due to a schema-validation failure that was swallowed. A model change or prompt regression causing the provider to return non-resume content. Rate-limiting/quota errors that the client surfaced as an empty response instead of an exception.

Related errors


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