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
- Change the import to 'react-server-dom-webpack/client' for payload consumption
- Use 'react-server-dom-webpack/server' (+ --conditions react-server) for serialization
- 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
- Use the lint rule from error 367 repo-wide
- When upgrading deps, grep for bare package imports in node_modules consumers you control
- Prefer subpath imports in all new code
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
- Use react-server-dom-webpack/client instead.
- Use react-server-dom-parcel/client instead.
- Use react-server-dom-parcel/client instead.
- The React Server Writer cannot be used outside a react-serve
- Use react-server-dom-turbopack/client instead.
AI-assisted analysis of facebook/react@eafeac097b (2026-08-21).
Data as JSON: /api/errors/a1a067e414bed835.
Report an issue: GitHub.