facebook/react · error · Error

248

248

Error message

Not implemented.

What it means

ReactMarkupLegacyClientStreamConfig is re-exported as the markup fork of ReactFlightClientConfig (react-client), but its byte-chunk decoding surface is stubbed: readPartialStringChunk always throws 'Not implemented.'. The markup Flight protocol transfers string chunks only, so any code path that asks this config to decode a partial binary chunk is unsupported by design.

Source

Thrown at packages/react-markup/src/ReactMarkupLegacyClientStreamConfig.js:20

 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 *
 * @flow
 */

export type StringDecoder = null;

export function createStringDecoder(): null {
  return null;
}

export function readPartialStringChunk(
  decoder: StringDecoder,
  buffer: Uint8Array,
): string {
  throw new Error('Not implemented.');
}

export function readFinalStringChunk(
  decoder: StringDecoder,
  buffer: Uint8Array,
): string {
  throw new Error('Not implemented.');
}

View on GitHub (pinned to eafeac097b)

Solutions

  1. Deliver chunks as strings: decode bytes yourself and push them through processFlightStringChunk.
  2. If you must stream bytes, use the standard Flight client config (the dom/node forks of ReactFlightClientConfig) rather than the markup fork.
  3. Treat readPartialStringChunk/readFinalStringChunk on the markup config as unsupported and never call them.

Example fix

// before
readPartialStringChunk(decoder, uint8ArrayChunk); // throws: not implemented

// after - decode to a string and use the string-chunk path
processFlightStringChunk(
  flightResponse,
  streamState,
  new TextDecoder().decode(uint8ArrayChunk),
);
Defensive patterns

Strategy: type-guard

Validate before calling

const isStringChunk = chunk => typeof chunk === 'string';
function feedChunk(flightResponse, streamState, chunk) {
  const text = isStringChunk(chunk)
    ? chunk
    : new TextDecoder().decode(chunk);
  processFlightStringChunk(flightResponse, streamState, text);
}

Type guard

const isStringChunk = chunk => typeof chunk === 'string';

Prevention

When it happens

Trigger: Feeding Uint8Array/binary chunks into the markup-mode Flight client - i.e. invoking readPartialStringChunk (directly or through a stream reader built on this config) - instead of delivering string chunks via processFlightStringChunk as experimental_renderToHTML's internal pipeline does.

Common situations: Hand-wiring a Flight client under the 'markup' resolve condition; piping Node Buffers or byte streams where the markup string protocol is expected; tooling that assumes the generic Flight client byte API.

Related errors


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