facebook/react · critical · Error
Use react-server-dom-turbopack/client instead.
Error message
Use react-server-dom-turbopack/client instead.
What it means
The published npm root entry of react-server-dom-turbopack (npm/index.js) is intentionally a throwing stub: the package has no main implementation, and consumers must deep-import an environment entry such as /client. Importing the bare package name fails immediately at module load.
Source
Thrown at packages/react-server-dom-turbopack/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-turbopack/client instead.');
View on GitHub (pinned to eafeac097b)
Solutions
- Import from react-server-dom-turbopack/client for client runtimes
- Use the server entries only under the react-server Node condition
- Add an ESLint no-restricted-imports rule for the bare specifier to catch regressions
Example fix
// before
const {createFromReadableStream} = require('react-server-dom-turbopack');
// after
const {createFromReadableStream} = require('react-server-dom-turbopack/client'); Defensive patterns
Strategy: validation
Validate before calling
// Prefer static subpath imports; guard dynamic resolution:
function turbopackEntry(kind) {
const spec = `react-server-dom-turbopack/${kind}`;
if (!['client', 'server.node'].includes(kind)) {
throw new Error(`Unsupported turbopack entry: ${kind}`);
}
return require(spec);
} Prevention
- Never require the package root; always a subpath
- Ban the bare specifier with import lint rules
- Document the correct entries in the repo README for new contributors
When it happens
Trigger: require('react-server-dom-turbopack') or `import from 'react-server-dom-turbopack'` in any environment, because the root always throws instead of resolving an implementation.
Common situations: Migrating from react-server-dom-webpack whose root entry was importable; tooling that auto-inserts the package root; older snippets copied into a turbopack-based app.
Related errors
- Use react-server-dom-turbopack/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
- react-dom/profiling is not supported in React Server Compone
AI-assisted analysis of facebook/react@eafeac097b (2026-08-21).
Data as JSON: /api/errors/16fb93180b3b29b8.
Report an issue: GitHub.