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
- Change the import to 'react-server-dom-parcel/client'
- Use 'react-server-dom-parcel/server' on the server under --conditions react-server
- 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
- Import subpaths only — the root entry is a guard, not an API
- Codemod existing imports after upgrading to versions with the guard
- Keep the lint rule enabled in CI
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
- Use react-server-dom-parcel/client instead.
- Use react-server-dom-webpack/client instead.
- Use react-server-dom-webpack/client instead.
- The React Server Writer cannot be used outside a react-serve
- The React Server Writer cannot be used outside a react-serve
AI-assisted analysis of facebook/react@eafeac097b (2026-08-21).
Data as JSON: /api/errors/dc24ae8195f6fe14.
Report an issue: GitHub.