{"record":{"id":"16fb93180b3b29b8","repo":"facebook/react","slug":"use-react-server-dom-turbopack-client-instead-16fb93","errorCode":null,"errorMessage":"Use react-server-dom-turbopack/client instead.","messagePattern":"Use react-server-dom-turbopack/client instead\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"packages/react-server-dom-turbopack/npm/index.js","lineNumber":12,"sourceCode":"/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\n'use strict';\n\nthrow new Error('Use react-server-dom-turbopack/client instead.');\n","sourceCodeStart":1,"sourceCodeEnd":13,"githubUrl":"https://github.com/facebook/react/blob/eafeac097ba51e1eab809c07102126bd5f8e5425/packages/react-server-dom-turbopack/npm/index.js#L1-L13","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before\nconst {createFromReadableStream} = require('react-server-dom-turbopack');\n\n// after\nconst {createFromReadableStream} = require('react-server-dom-turbopack/client');","handlingStrategy":"validation","validationCode":"// Prefer static subpath imports; guard dynamic resolution:\nfunction turbopackEntry(kind) {\n  const spec = `react-server-dom-turbopack/${kind}`;\n  if (!['client', 'server.node'].includes(kind)) {\n    throw new Error(`Unsupported turbopack entry: ${kind}`);\n  }\n  return require(spec);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"tags":["react-server-components","turbopack","npm","package-exports","import-time-error"],"backgroundTag":"invalid-package-entrypoint","analyzedSha":"eafeac097ba51e1eab809c07102126bd5f8e5425","analyzedAt":"2026-08-21T22:01:08.818Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}