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
- Use the subpath export: `import ... from 'react-server-dom-unbundled/client'` in browser code.
- Use 'react-server-dom-unbundled/server' only in react-server conditioned server code.
- 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
- Import 'react-server-dom-unbundled/client' in browser code and '.../server' only under the react-server condition.
- Fix editor auto-imports that suggest the package root.
- Add the lint rule above so CI fails on the bare specifier.
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
- 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
- The React Server cannot be used outside a react-server envir
- The source map has more mappings than there are lines.
AI-assisted analysis of facebook/react@eafeac097b (2026-08-21).
Data as JSON: /api/errors/176fce210146f217.
Report an issue: GitHub.