{"record":{"id":"b86f2e09ea6f1dbc","repo":"facebook/react","slug":"react-server-plugin-you-must-specify-the-isserver","errorCode":null,"errorMessage":"React Server Plugin: You must specify the isServer option as a boolean.","messagePattern":"React Server Plugin: You must specify the isServer option as a boolean\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/react-server-dom-webpack/src/ReactFlightWebpackPlugin.js","lineNumber":74,"sourceCode":"type Options = {\n  isServer: boolean,\n  clientReferences?: ClientReferencePath | $ReadOnlyArray<ClientReferencePath>,\n  chunkName?: string,\n  clientManifestFilename?: string,\n  serverConsumerManifestFilename?: string,\n};\n\nconst PLUGIN_NAME = 'React Server Plugin';\n\nexport default class ReactFlightWebpackPlugin {\n  clientReferences: $ReadOnlyArray<ClientReferencePath>;\n  chunkName: string;\n  clientManifestFilename: string;\n  serverConsumerManifestFilename: string;\n\n  constructor(options: Options) {\n    if (!options || typeof options.isServer !== 'boolean') {\n      throw new Error(\n        PLUGIN_NAME + ': You must specify the isServer option as a boolean.',\n      );\n    }\n    if (options.isServer) {\n      throw new Error('TODO: Implement the server compiler.');\n    }\n    if (!options.clientReferences) {\n      this.clientReferences = [\n        {\n          directory: '.',\n          recursive: true,\n          include: /\\.(js|ts|jsx|tsx)$/,\n        },\n      ];\n    } else if (\n      typeof options.clientReferences === 'string' ||\n      !isArray(options.clientReferences)\n    ) {","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/facebook/react/blob/eafeac097ba51e1eab809c07102126bd5f8e5425/packages/react-server-dom-webpack/src/ReactFlightWebpackPlugin.js#L56-L92","documentation":"ReactFlightWebpackPlugin validates its constructor options: options.isServer must be present and a boolean, otherwise construction throws. The plugin branches on this flag (client manifest generation vs server compiler), so an undefined/string value — usually a typo'd or missing key — fails fast at webpack config evaluation time.","triggerScenarios":"new ReactFlightWebpackPlugin({}) with no isServer; passing isServer: 'false' (string) or a variable that is undefined; spreading an options object that lacks the key.","commonSituations":"Copying example configs that omit the option | Config refactors that rename or conditionally delete the key | Version upgrades where the option became required","solutions":["Set isServer explicitly as a boolean: isServer: false for the client-manifest pass","Check for typos in the key and for accidental undefined (e.g. env ? false : undefined)","Validate options early in your webpack config so mistakes surface with your own message"],"exampleFix":"// before\nnew ReactFlightWebpackPlugin({clientReferences: [...]})\n\n// after\nnew ReactFlightWebpackPlugin({isServer: false, clientReferences: [...]})","handlingStrategy":"validation","validationCode":"// Validate before constructing\nfunction validatePluginOptions(options) {\n  if (!options || typeof options.isServer !== 'boolean') {\n    throw new Error('ReactFlightWebpackPlugin requires options.isServer: boolean');\n  }\n  return options;\n}\nnew ReactFlightWebpackPlugin(validatePluginOptions(cfg));","typeGuard":"function areValidPluginOptions(o) {\n  return o != null && typeof o.isServer === 'boolean';\n}","tryCatchPattern":null,"preventionTips":["Default the key explicitly: {isServer: false, ...spread}","Type your webpack config (flow/ts) so a missing key fails the build","Re-check options after config refactors or upgrades"],"tags":["webpack","plugin","options","validation","react-server-components"],"backgroundTag":"plugin-option-validation","analyzedSha":"eafeac097ba51e1eab809c07102126bd5f8e5425","analyzedAt":"2026-08-21T22:01:08.818Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}