facebook/react · error · Error
No server callback has been registered. Call setServerCallba
Error message
No server callback has been registered. Call setServerCallback to register one.
What it means
react-server-dom-parcel's browser client ships no default transport for invoking Server Functions — the host framework supplies one via setServerCallback(fn). Every server reference decoded from a Flight payload routes through callCurrentServerCallback; if no callback was registered before the first invocation, it throws.
Source
Thrown at packages/react-server-dom-parcel/src/client/ReactFlightDOMClientBrowser.js:65
qs.set('env', environmentName);
return devServer + '/__parcel_source_map?' + qs.toString();
}
return null;
}
type CallServerCallback = <A, T>(id: string, args: A) => Promise<T>;
let callServer: CallServerCallback | null = null;
export function setServerCallback(fn: CallServerCallback) {
callServer = fn;
}
function callCurrentServerCallback<A, T>(
id: ServerReferenceId,
args: A,
): Promise<T> {
if (!callServer) {
throw new Error(
'No server callback has been registered. Call setServerCallback to register one.',
);
}
return callServer(id, args);
}
export function createServerReference<A: Iterable<any>, T>(
id: string,
exportName: string,
): (...A) => Promise<T> {
return createServerReferenceImpl(
id + '#' + exportName,
callCurrentServerCallback,
undefined,
findSourceMapURL,
exportName,
);
}View on GitHub (pinned to eafeac097b)
Solutions
- Call setServerCallback once at the very top of the client entry, before rendering anything that can invoke actions
- Implement the callback as a POST of {id, args} that decodes the returned Flight payload using createFrom*
- If an action can slip through early, queue or defer it until the callback is registered
Example fix
// before — no transport registered
import {createFromFetch} from 'react-server-dom-parcel/client';
// later: saveNote() throws
// after — bootstrap first
import {setServerCallback, createFromFetch} from 'react-server-dom-parcel/client';
setServerCallback(async (id, args) => {
const payload = fetch('/server-endpoint', {
method: 'POST',
body: JSON.stringify({id, args}),
});
return createFromFetch(payload, window.__serverManifest);
}); Defensive patterns
Strategy: validation
Validate before calling
import {setServerCallback} from 'react-server-dom-parcel/client';
let installed = false;
export function installServerCallback(fn) {
setServerCallback(fn);
installed = true;
}
export function canCallServer() {
return installed;
}
// gate action call sites: if (!canCallServer()) queue or disable the action Try / catch
try {
await action(...args);
} catch (e) {
if (/No server callback has been registered/.test(e.message)) {
// bootstrap ordering bug — register the callback, then surface a retry prompt
}
throw e;
} Prevention
- Call setServerCallback as the first statement of the client entry
- Keep bootstrap ordering deterministic (callback before any component bundle runs)
- Expose a canCallServer() flag and gate action UI on it
When it happens
Trigger: Calling any server function before setServerCallback(...) has run: an action invoked at module scope or during first render before the bootstrap executed; an SSR entry hitting an action; the bootstrap script missing entirely.
Common situations: Custom Parcel-based RSC frameworks wiring their own POST endpoint; script-ordering issues where the component bundle executes before the bootstrap; copying a minimal example and omitting the setup step.
Related errors
- Invalid server action: ${ref}
- Server actions must be functions
- Server actions must be functions
- Attempted to load a Server Reference outside the hosted root
- Server Functions cannot be called during initial render. Thi
AI-assisted analysis of facebook/react@eafeac097b (2026-08-21).
Data as JSON: /api/errors/9548b47bd7618f05.
Report an issue: GitHub.