facebook/react · error · Error

createFastHash is not supported in this environment.

Error message

createFastHash is not supported in this environment.

What it means

ReactServerStreamConfigFB is the Flight-server stream config for Meta's FB runtime; it implements that runtime's stream helpers but deliberately stubs createFastHash to throw, since no fast hasher exists in this environment. createFastHash is consumed by ReactFizzHooks' createPostbackActionStateKey to compress a useActionState hook's key path into a postback key — and that hash is only computed when useActionState was called without a permalink.

Source

Thrown at packages/react-flight-server-fb/src/ReactServerStreamConfigFB.js:232

}

export function byteLengthOfChunk(chunk: Chunk | PrecomputedChunk): number {
  return typeof chunk === 'string'
    ? Buffer.byteLength(chunk, 'utf8')
    : chunk.byteLength;
}

export function byteLengthOfBinaryChunk(chunk: BinaryChunk): number {
  return chunk.byteLength;
}

export function closeWithError(destination: Destination, error: mixed): void {
  // $FlowFixMe[incompatible-type]: This is an Error object or the destination accepts other types.
  destination.destroy(error);
}

export function createFastHash(_input: string): string | number {
  throw new Error('createFastHash is not supported in this environment.');
}

export function readAsDataURL(blob: Blob): Promise<string> {
  return blob.arrayBuffer().then(arrayBuffer => {
    const encoded = Buffer.from(arrayBuffer).toString('base64');
    const mimeType = blob.type || 'application/octet-stream';
    return 'data:' + mimeType + ';base64,' + encoded;
  });
}

View on GitHub (pinned to eafeac097b)

Solutions

  1. Pass a permalink as the third argument to useActionState — permalink-based keys bypass createFastHash completely
  2. Ensure the FB runtime module expected to supply hashing is initialized before rendering
  3. Fix bundler aliases so non-FB environments resolve ReactServerStreamConfigNode/Browser instead of the FB fork

Example fix

// before
const [state, formAction] = useActionState(signupAction, initialState);

// after
const [state, formAction] = useActionState(signupAction, initialState, 'newsletter-signup');
Defensive patterns

Strategy: validation

Validate before calling

// A permalink makes the postback key hash-free, avoiding createFastHash entirely
const hasPermalink = typeof permalink === 'string' && permalink.length > 0;
const [state, formAction] = hasPermalink
  ? useActionState(action, initialState, permalink)
  : useActionState(action, initialState, 'stable-key'); // always supply one in FB builds

Try / catch

try {
  const html = await renderToPipeableStream(<Form />);
  return html;
} catch (e) {
  if (e instanceof Error && e.message.includes('createFastHash is not supported')) {
    throw new Error(
      'useActionState was called without a permalink in an environment without fast hashing — add a permalink argument'
    );
  }
  throw e;
}

Prevention

When it happens

Trigger: Server rendering (Flight/Fizz under the react-flight-server-fb build) a component that calls useActionState(action, initialState) with no third permalink argument: createPostbackActionStateKey hashes the key path via createFastHash and hits the throwing stub. Passing a permalink returns 'p' + permalink and skips the hash entirely.

Common situations: Meta-internal www builds rendering progressive-enhancement forms in an environment that does not supply the native fast hash; OSS consumers accidentally resolving the FB fork of the stream config through bundler aliases.

Related errors


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