{"record":{"id":"5ea174f8d3e768e0","repo":"facebook/react","slug":"use-react-server-dom-webpack-client-instead-5ea174","errorCode":null,"errorMessage":"Use react-server-dom-webpack/client instead.","messagePattern":"Use react-server-dom-webpack/client instead\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/react-server-dom-webpack/index.js","lineNumber":10,"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\nthrow new Error('Use react-server-dom-webpack/client instead.');\n","sourceCodeStart":1,"sourceCodeEnd":11,"githubUrl":"https://github.com/facebook/react/blob/eafeac097ba51e1eab809c07102126bd5f8e5425/packages/react-server-dom-webpack/index.js#L1-L11","documentation":"The package root of react-server-dom-webpack (index.js) is a deliberate dead end: its exports map routes './client' to browser/node client code and './server' to the react-server-only server code, leaving the bare root for the leftover case (typically Node require without the react-server condition). Importing the root always throws 'Use react-server-dom-webpack/client instead.' to push you to an explicit entry point.","triggerScenarios":"require('react-server-dom-webpack') or import from 'react-server-dom-webpack' anywhere — the root entry exists only to reject this.","commonSituations":"Copy-pasting old examples that imported the package root before entries were split | Auto-import IDE completion choosing the package root | Shared isomorphic modules that try to import one path for both environments","solutions":["Client code: import from 'react-server-dom-webpack/client' (or /client.browser, /client.node, /client.edge)","Server code: import from 'react-server-dom-webpack/server' or /static with Node running --conditions react-server","Add an ESLint no-restricted-imports rule banning the bare package name so this is caught at lint time"],"exampleFix":"// before\nimport {createFromReadableStream} from 'react-server-dom-webpack';\n\n// after\nimport {createFromReadableStream} from 'react-server-dom-webpack/client';","handlingStrategy":"validation","validationCode":"// eslint: ban the bare import forever\n// eslint.config.js\n'no-restricted-imports': ['error', {\n  paths: [{name: 'react-server-dom-webpack', message: 'Use react-server-dom-webpack/client or /server.'}],\n}]","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always import an explicit subpath (client, client.node, server, static)","Set up the lint rule once per repo","Let module auto-import pick from the exports map, never type the bare name"],"tags":["react-server-components","webpack","package-exports","imports"],"backgroundTag":"wrong-package-entry-point","analyzedSha":"eafeac097ba51e1eab809c07102126bd5f8e5425","analyzedAt":"2026-08-21T22:01:08.818Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}