facebook/react · error · Error

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

Error message

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

What it means

The npm build of react-server-dom-unbundled resolves its root export to a stub that throws. The package is only meaningful through its /server and /client subpaths; importing the bare package name is always a mistake, and the error tells you the correct client entry to use.

Source

Thrown at packages/react-server-dom-unbundled/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-unbundled/client instead.');

View on GitHub (pinned to eafeac097b)

Solutions

  1. Use the subpath export: `import ... from 'react-server-dom-unbundled/client'` in browser code.
  2. Use 'react-server-dom-unbundled/server' only in react-server conditioned server code.
  3. Add an ESLint no-restricted-imports pattern to block the bare specifier.

Example fix

// before
import { createFromFetch } from 'react-server-dom-unbundled';

// after
import { createFromFetch } from 'react-server-dom-unbundled/client';
Defensive patterns

Strategy: validation

Validate before calling

// eslint: ban the bare specifier
"no-restricted-imports": ["error", { paths: [{ name: "react-server-dom-unbundled", message: "Use react-server-dom-unbundled/client or /server." }] }]

Prevention

When it happens

Trigger: `import ... from 'react-server-dom-unbundled'` in code that resolves to packages/react-server-dom-unbundled/npm/index.js (the published root), e.g. client components or misconfigured module resolution.

Common situations: Editor auto-imports picking the package root; copy-pasted snippets from a different RSC runtime; bundler `alias` config mapping the bare name to the package root.

Related errors


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