{"record":{"id":"f00592ddc68eb65d","repo":"facebook/react","slug":"the-react-server-cannot-be-used-outside-a-react-se-f00592","errorCode":null,"errorMessage":"The React Server cannot be used outside a react-server environment. You must configure Node.js using the `--conditions react-server` flag.","messagePattern":"The React Server cannot be used outside a react-server environment\\. You must configure Node\\.js using the `--conditions react-server` flag\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"packages/react-server-dom-turbopack/server.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(\n  'The React Server cannot be used outside a react-server environment. ' +\n    'You must configure Node.js using the `--conditions react-server` flag.',\n);\n","sourceCodeStart":1,"sourceCodeEnd":14,"githubUrl":"https://github.com/facebook/react/blob/eafeac097ba51e1eab809c07102126bd5f8e5425/packages/react-server-dom-turbopack/server.js#L1-L14","documentation":"The turbopack Flight server entry throws at import time unless the react-server Node condition is active. The export map swaps this stub for the real server runtime only when Node resolves conditions include react-server, preventing the serialization runtime from loading in client contexts.","triggerScenarios":"import/require of react-server-dom-turbopack/server in a Node process started without --conditions react-server, or via a bundler that resolved the fallback export.","commonSituations":"Plain `node` invocations of server entrypoints; CI scripts and test runners that do not forward Node conditions; framework configs that dropped the flag after an upgrade.","solutions":["Launch with node --conditions react-server wherever the server entry loads","Scope server-entry imports to react-server conditional branches only","Verify test/bundler config propagates react-server so the real entry resolves"],"exampleFix":"# before\n$ node server.js   # import of react-server-dom-turbopack/server throws\n\n# after\n$ node --conditions react-server server.js","handlingStrategy":"validation","validationCode":"const args = process.execArgv.join(' ');\nif (!args.includes('react-server')) {\n  throw new Error('Flight server entry requires --conditions react-server');\n}\nconst {renderToPipeableStream} = require('react-server-dom-turbopack/server');","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Include --conditions react-server in all server-launch scripts","Scope server-entry imports to react-server conditional branches","Verify CI and test configs forward the condition"],"tags":["react-server-components","turbopack","node-conditions","environment","import-time-error"],"backgroundTag":"react-server-condition-missing","analyzedSha":"eafeac097ba51e1eab809c07102126bd5f8e5425","analyzedAt":"2026-08-21T22:01:08.818Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}