facebook/react · error · Error

568

568

Error message

Already initialized typed array.

What it means

parseTypedArray revives a serialized typed array (backed by a Blob entry in FormData) under a fresh chunk id. If that id already exists in the response chunk map, the payload declared the same typed array twice, so React throws and additionally plants an errored chunk for that id.

Source

Thrown at packages/react-server/src/ReactFlightReplyServer.js:1243

  }
  return model;
}

function parseTypedArray<T: $ArrayBufferView | ArrayBuffer>(
  response: Response,
  reference: string,
  constructor: any,
  bytesPerElement: number,
  parentObject: Object,
  parentKey: string,
  referenceArrayRoot: null | NestedArrayContext,
): null {
  const id = parseInt(reference.slice(2), 16);
  const prefix = response._prefix;
  const key = prefix + id;
  const chunks = response._chunks;
  if (chunks.has(id)) {
    throw new Error('Already initialized typed array.');
  }
  chunks.set(
    id,
    // We don't need to put the actual Blob in the chunk,
    // because it shouldn't be accessed by anything else.
    createErroredChunk(response, new Error('Already initialized typed array.')),
  );

  // We should have this backingEntry in the store already because we emitted
  // it before referencing it. It should be a Blob.
  const backingEntry: Blob = getBackingEntry(response._formData, key) as any;

  const promise: Promise<ArrayBuffer> = backingEntry.arrayBuffer();

  // Since loading the buffer is an async operation we'll be blocking the parent
  // chunk.

  let handler: InitializationHandler;

View on GitHub (pinned to eafeac097b)

Solutions

  1. Reject the submission: catch around decodeReply and return 400.
  2. Never replay or reuse captured action payloads; submit fresh ones.
  3. Ensure client and server React versions match.
Defensive patterns

Strategy: try-catch

Try / catch

try {
  const args = await decodeReply(formData);
} catch (e) {
  return new Response('Bad request', {status: 400});
}

Prevention

When it happens

Trigger: Two typed-array entries in the reply share one chunk id - duplicated multipart fields, replayed/captured FormData, or an encoder from a mismatched React version reusing ids.

Common situations: Replayed submissions from caches; forged requests; version skew between the serializing client and the decoding server.

Related errors


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