facebook/react · error · Error

580

580

Error message

Server Function has too many bound arguments. Received %s but the limit is %s.

What it means

Server References ('use server' functions) support partial application via .bind, and the wire protocol caps the stored bound arguments at MAX_BOUND_ARGS = 1000 (defined in ReactFlightReplyServer). bindArgs in ReactFlightActionServer throws error code 580 when the server reconstructs a bound server reference with more than 1000 stored arguments; the client-side serializer enforces the same cap.

Source

Thrown at packages/react-server/src/ReactFlightActionServer.js:34

import {
  resolveServerReference,
  preloadModule,
  requireModule,
} from 'react-client/src/ReactFlightClientConfig';

import {
  createResponse,
  close,
  getRoot,
  MAX_BOUND_ARGS,
} from './ReactFlightReplyServer';

type ServerReferenceId = any;

function bindArgs(fn: any, args: any) {
  if (args.length > MAX_BOUND_ARGS) {
    throw new Error(
      'Server Function has too many bound arguments. Received ' +
        args.length +
        ' but the limit is ' +
        MAX_BOUND_ARGS +
        '.',
    );
  }

  return fn.bind.apply(fn, [null].concat(args));
}

function loadServerReference<T>(
  bundlerConfig: ServerManifest,
  metaData: {
    id: ServerReferenceId,
    bound: null | Promise<Array<any>>,
  },
): Promise<T> {

View on GitHub (pinned to eafeac097b)

Solutions

  1. Pass one object or array argument containing the data instead of binding many positional arguments
  2. Split the work across multiple server action calls if the payload is genuinely huge
  3. Remember each .bind call appends to the stored bound args toward the 1000 limit

Example fix

// before
const save = saveRows.bind(null, ...rows); // rows.length > 1000 -> throws
<form action={save}>...</form>

// after
const save = saveRows.bind(null, {rows}); // single payload argument
<form action={save}>...</form>
Defensive patterns

Strategy: validation

Validate before calling

const MAX_BOUND_ARGS = 1000; // React's limit (ReactFlightReplyServer)
function bindServerAction(fn, ...args) {
  if (args.length > MAX_BOUND_ARGS) {
    throw new RangeError(`Too many bound args: ${args.length} > ${MAX_BOUND_ARGS}`);
  }
  return fn.bind(null, ...args);
}

Prevention

When it happens

Trigger: Client code calling serverAction.bind(null, ...hugeArray), or accumulating arguments across repeated .bind calls (over 1000 total), then invoking the bound action (form action or transition) so the server rejects the decoded reference.

Common situations: Passing large row datasets to a server action via bind instead of a single payload object; programmatic bind loops; spreading request data into .bind.

Related errors


AI-assisted analysis of facebook/react@eafeac097b (2026-08-21). Data as JSON: /api/errors/c598671c75708cf1. Report an issue: GitHub.