facebook/relay · error
Relay: Missing @required value at path '${fieldError.fieldPa
Error message
Relay: Missing @required value at path '${fieldError.fieldPath}' in '${fieldError.owner}': ${reason}. What it means
Thrown by handleFieldErrors when a field marked @required resolves to a missing value (null or an error) at the required path. Relay enforces @required as a hard invariant: the server response failed to satisfy the fragment contract, so the snapshot cannot be trusted and the read is aborted with an exception rather than returning null. The message distinguishes null fieldValue from an underlying field error as the reason.
Source
Thrown at packages/relay-runtime/util/handlePotentialSnapshotErrors.js:70
throw new Error(
`Relay: Received a field error in the server response for field '${fieldError.fieldPath}' in '${fieldError.owner}'. Message: ${fieldError.error.message}`,
);
case 'missing_expected_data.throw':
throw new Error(
`Relay: Missing expected data at path '${fieldError.fieldPath}' in '${fieldError.owner}'. See https://relay.dev/docs/next/debugging/why-null/ for likely causes.`,
);
case 'missing_required_field.throw': {
let reason: string;
if (fieldError.fieldValue === null) {
reason =
fieldError.fieldError != null
? `the server returned null with an error: ${fieldError.fieldError.message}`
: 'the server returned null';
} else {
reason =
'the field was missing in the store (data may not have been fetched, or was removed by a graph relationship change: https://relay.dev/docs/next/debugging/why-null/#graph-relationship-change)';
}
throw new Error(
`Relay: Missing @required value at path '${fieldError.fieldPath}' in '${fieldError.owner}': ${reason}.`,
);
}
case 'missing_required_field.log':
case 'missing_expected_data.log':
// These should have already been filtered out. Sadly, Flow Type
// Guards don't work well with refining discriminated unions, so we
// can't assert this via types.
break;
default:
fieldError.kind as empty;
invariant(false, 'Relay: Unexpected event kind: %s', fieldError.kind);
}
}
}
}
function eventShouldThrow(event: FieldError): boolean {View on GitHub (pinned to 668b1b85e0)
Solutions
- Check the server response for the field at fieldError.fieldPath — it was null or errored despite @required
- Verify the @required directive's arguments (@required(action: THROW) vs LOG) match the intended nullability semantics
- Use the Relay DevTools or the why-null debugging guide to trace which resolver/link in the owner produced the missing value
- If the field can legitimately be absent, remove @required or switch to @required(action: LOG) and handle null in UI code
- Fix an upstream resolver or @relay_resolver that fails to propagate a value
Defensive patterns
Strategy: type-guard
When it happens
Trigger: Thrown at packages/relay-runtime/util/handlePotentialSnapshotErrors.js:70 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of facebook/relay@668b1b85e0 (2026-09-02).
Data as JSON: /api/errors/548d49f8da75e37e.
Report an issue: GitHub.