facebook/react · error · Error

Use react-server-dom-webpack/client instead.

Error message

Use react-server-dom-webpack/client instead.

What it means

The npm/ copy of the webpack package's root index.js throws the same 'Use react-server-dom-webpack/client instead.' guard as the source index.js — it is the entry published for consumers who import the package root. The package intentionally has no root implementation; every consumer must pick the client, server, or static subpath matched to its runtime condition.

Source

Thrown at packages/react-server-dom-webpack/npm/index.js:12

/**
 * 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
 */

'use strict';

throw new Error('Use react-server-dom-webpack/client instead.');

View on GitHub (pinned to eafeac097b)

Solutions

  1. Change the import to 'react-server-dom-webpack/client' for payload consumption
  2. Use 'react-server-dom-webpack/server' (+ --conditions react-server) for serialization
  3. If a dependency imports the root, update it or file an issue — the fix is always the subpath

Example fix

// before
const {createFromNodeStream} = require('react-server-dom-webpack');

// after
const {createFromNodeStream} = require('react-server-dom-webpack/client.node');
Defensive patterns

Strategy: validation

Validate before calling

// Check dependencies' imports before shipping
// package.json script: "check:imports": "grep -r \"from 'react-server-dom-webpack'\" --include=*.js src || true"

Prevention

When it happens

Trigger: require('react-server-dom-webpack') from installed node_modules (any Node process, test, or tool that resolves the package root).

Common situations: Upgrading from very old versions where the root re-exported client APIs | SSR frameworks or starter templates importing the root in shared code | Node scripts that render RSC payloads using the root import

Related errors


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