facebook/react · warning

You did not run Node.js with the `--conditions react-server`

Error message

You did not run Node.js with the `--conditions react-server` flag. Any "react-server" override will only work with ESM imports.

What it means

The webpack-flavored RSC node loader (react-server-dom-webpack, ReactFlightWebpackNodeLoader.js:82) carries the same resolve hook: it needs the 'react-server' export condition to pick server bundles of client-referenced modules. When node lacks --conditions react-server, the hook injects the condition only for specifiers it resolves and warns once that anything loaded through CommonJS require() keeps resolving without it.

Source

Thrown at packages/react-server-dom-webpack/src/ReactFlightWebpackNodeLoader.js:82

let stashedResolve: null | ResolveFunction = null;

export async function resolve(
  specifier: string,
  context: ResolveContext,
  defaultResolve: ResolveFunction,
): Promise<{url: string}> {
  // We stash this in case we end up needing to resolve export * statements later.
  stashedResolve = defaultResolve;

  if (!context.conditions.includes('react-server')) {
    context = {
      ...context,
      conditions: [...context.conditions, 'react-server'],
    };
    if (!warnedAboutConditionsFlag) {
      warnedAboutConditionsFlag = true;
      // eslint-disable-next-line react-internal/no-production-logging
      console.warn(
        'You did not run Node.js with the `--conditions react-server` flag. ' +
          'Any "react-server" override will only work with ESM imports.',
      );
    }
  }
  return await defaultResolve(specifier, context, defaultResolve);
}

export async function getSource(
  url: string,
  context: GetSourceContext,
  defaultGetSource: GetSourceFunction,
): Promise<{source: Source}> {
  // We stash this in case we end up needing to resolve export * statements later.
  stashedGetSource = defaultGetSource;
  return defaultGetSource(url, context, defaultGetSource);
}

View on GitHub (pinned to eafeac097b)

Solutions

  1. Add --conditions react-server to the node invocation for dev, build-time, and runtime scripts
  2. Verify with `node -p "process.execArgv"` in the target environment that the flag survived
  3. Use NODE_OPTIONS when launching through process managers
  4. Make sure the packages that need the condition expose it via ESM exports maps

Example fix

// before
CMD ["node", "dist/server.js"]

// after
CMD ["node", "--conditions", "react-server", "dist/server.js"]
Defensive patterns

Strategy: validation

Validate before calling

// in the server bootstrap, before any client-reference import
if (!process.execArgv.join(' ').includes('react-server')) {
  console.error('restart with: node --conditions react-server');
  process.exit(1);
}

Prevention

When it happens

Trigger: A node SSR/RSC server that registers the react-server-dom-webpack loader (typically alongside a webpack build with 'react-server' condition exports) but is started without --conditions react-server.

Common situations: Webpack-based RSC setups where the dev script was updated but the production/Docker start command was not; CJS server bundles produced by the same webpack build resolving different versions in dev vs prod.

Related errors


AI-assisted analysis of facebook/react@eafeac097b (2026-08-21). Data as JSON: /api/errors/adf60cedc2008dc4. Report an issue: GitHub.