facebook/react · error · Error

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

Error message

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

What it means

Same guard as the source entry, compiled into the published npm build: react-server-dom-parcel's root entry always throws because the package is only consumable through subpath exports ('./client' in browser/edge/node, './server' under the react-server condition). Reaching this module means the bare package specifier was imported.

Source

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

View on GitHub (pinned to eafeac097b)

Solutions

  1. Change the import to 'react-server-dom-parcel/client'
  2. Use 'react-server-dom-parcel/server' on the server under --conditions react-server
  3. Add a lint rule (no-restricted-imports) banning the bare specifier

Example fix

// before
import {createFromReadableStream} from 'react-server-dom-parcel';

// after
import {createFromReadableStream} from 'react-server-dom-parcel/client';
Defensive patterns

Strategy: validation

Validate before calling

// eslint.config.js — ban the bare specifier
export default [
  {
    rules: {
      'no-restricted-imports': ['error', {
        paths: [{
          name: 'react-server-dom-parcel',
          message: "Use 'react-server-dom-parcel/client' (or /server under react-server)",
        }],
      }],
    },
  },
];

Prevention

When it happens

Trigger: import {createFromFetch} from 'react-server-dom-parcel' resolves to npm/index.js and throws at module evaluation; bundler resolves via the main field; auto-import inserts the package root.

Common situations: IDE auto-import; migrating from react-server-dom-webpack (whose root also throws); starter templates referencing the package root.

Related errors


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