{"record":{"id":"176fce210146f217","repo":"facebook/react","slug":"use-react-server-dom-unbundled-client-instead","errorCode":null,"errorMessage":"Use react-server-dom-unbundled/client instead.","messagePattern":"Use react-server-dom-unbundled/client instead\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/react-server-dom-unbundled/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-unbundled/client instead.');\n","sourceCodeStart":1,"sourceCodeEnd":13,"githubUrl":"https://github.com/facebook/react/blob/eafeac097ba51e1eab809c07102126bd5f8e5425/packages/react-server-dom-unbundled/npm/index.js#L1-L13","documentation":"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.","triggerScenarios":"`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.","commonSituations":"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.","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."],"exampleFix":"// before\nimport { createFromFetch } from 'react-server-dom-unbundled';\n\n// after\nimport { createFromFetch } from 'react-server-dom-unbundled/client';","handlingStrategy":"validation","validationCode":"// eslint: ban the bare specifier\n\"no-restricted-imports\": [\"error\", { paths: [{ name: \"react-server-dom-unbundled\", message: \"Use react-server-dom-unbundled/client or /server.\" }] }]","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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."],"tags":["rsc","react-server-components","unbundled","imports","entry-point","npm"],"backgroundTag":"wrong-rsc-package-entry-point","analyzedSha":"eafeac097ba51e1eab809c07102126bd5f8e5425","analyzedAt":"2026-08-21T22:01:08.818Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}