{"record":{"id":"aa063fa59a365f4a","repo":"facebook/react","slug":"the-react-server-cannot-be-used-outside-a-react-se-aa063f","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-parcel/static.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-parcel/static.js#L1-L14","documentation":"react-server-dom-parcel/static is the Edge/static build of the Flight server. The package's export map resolves the real implementation only under the react-server Node condition; everything else resolves to this stub, which throws at import time so the server serialization runtime never loads inside a non-react-server process.","triggerScenarios":"Importing 'react-server-dom-parcel/static' (directly or transitively) in a Node process started without --conditions react-server, or when a bundler/test runner resolves the conditionless fallback export.","commonSituations":"Running server code with plain `node server.js`; jest/vitest runners that do not propagate Node execution conditions; deploy scripts or framework configs missing the react-server flag.","solutions":["Start Node with the condition flag: node --conditions react-server server.js","Load the server entry only inside code paths that run under the react-server condition (guarded dynamic require)","Configure bundlers and test runners to honor the react-server export condition"],"exampleFix":"# before\n$ node server.js   # importing react-server-dom-parcel/static 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('Start this process with --conditions react-server');\n}\nconst RSCServer = require('react-server-dom-parcel/static');","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Bake --conditions react-server into npm scripts that run server entrypoints","Mirror the react-server condition in jest/vitest and bundler configs","Never import server/static entries from shared isomorphic modules"],"tags":["react-server-components","parcel","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"}