{"record":{"id":"95c37fe3aca461e2","repo":"facebook/flow","slug":"unsupported-config-option-react-runtime","errorCode":null,"errorMessage":"Unsupported config option react.runtime={}","messagePattern":"Unsupported config option react\\.runtime=(.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"rust_port/crates/flow_dot_js_wasm/src/lib.rs","lineNumber":166,"sourceCode":"        \"unused-promise\",\n    ] {\n        if bool_config(config, lint, false) {\n            if let Some(kinds) = LintKind::parse_from_str(lint) {\n                for kind in kinds {\n                    lint_severities.set_value(kind, (Severity::Err, None));\n                }\n            }\n        }\n    }\n\n    let react_runtime = match config\n        .get(\"react.runtime\")\n        .and_then(Value::as_str)\n        .unwrap_or(\"automatic\")\n    {\n        \"classic\" => ReactRuntime::Classic,\n        \"automatic\" => ReactRuntime::Automatic,\n        other => panic!(\"Unsupported config option react.runtime={}\", other),\n    };\n\n    Options {\n        all: true,\n        assert_operator: if bool_config(config, \"experimental.assert_operator\", false) {\n            AssertOperator::Enabled\n        } else {\n            AssertOperator::Disabled\n        },\n        babel_loose_array_spread: bool_config(config, \"babel_loose_array_spread\", false),\n        component_syntax: true,\n        enable_const_params: bool_config(config, \"experimental.const_params\", false),\n        enable_pattern_matching: true,\n        enable_records: true,\n        enums: bool_config(config, \"enums\", true),\n        hook_compatibility: true,\n        lint_severities,\n        max_header_tokens: 10,","sourceCodeStart":148,"sourceCodeEnd":184,"githubUrl":"https://github.com/facebook/flow/blob/f88ac94bcf6992f5d5a158854d94613ebb92c6e6/rust_port/crates/flow_dot_js_wasm/src/lib.rs#L148-L184","documentation":"When flow.js wasm builds its Options from a user-supplied config map, react.runtime is read as a string defaulting to 'automatic'; only 'classic' and 'automatic' map to ReactRuntime variants, and any other value panics. This guards the JSX transform mode: classic uses React.createElement, automatic uses the jsx runtime imports.","triggerScenarios":"Passing a config object to the flow.js wasm API whose 'react.runtime' value is anything but 'classic' or 'automatic' — e.g. 'react-jsx', 'runtime', 'true', 'none', or a non-string JSON value coerced oddly. In .flowconfig terms, an unrecognized react.runtime= line surfaced through this path.","commonSituations":"Copying react.runtime values from Babel/eslint config vocabulary ('react-jsx', 'react-jsxdev', 'automatic-runtime') into flow's options; typos; booleans instead of strings; presets forwarding raw editor settings into flow.js.","solutions":["Set react.runtime to 'automatic' (default) or 'classic' — the only supported values","Remove the react.runtime option entirely to get the 'automatic' default","Check spelling and quoting of the value (must be the exact strings classic/automatic)","If forwarding configs from other tools, map their JSX-transform names to these two values"],"exampleFix":"// before (config passed to flow.js wasm)\nconst config = { 'react.runtime': 'react-jsx' }; // panics: Unsupported config option react.runtime=react-jsx\n\n// after\nconst config = { 'react.runtime': 'automatic' }; // or 'classic', or omit the key","handlingStrategy":"validation","validationCode":"// validate before passing config into the flow.js wasm API\nconst VALID_REACT_RUNTIME = ['classic', 'automatic'];\nfunction validateConfig(config) {\n  const v = config['react.runtime'] ?? 'automatic';\n  if (!VALID_REACT_RUNTIME.includes(v)) {\n    throw new RangeError(`react.runtime must be one of ${VALID_REACT_RUNTIME.join('|')}, got ${JSON.stringify(v)}`);\n  }\n  return config;\n}","typeGuard":"function isReactRuntimeValue(v) {\n  return v === undefined || v === 'classic' || v === 'automatic';\n}","tryCatchPattern":null,"preventionTips":["Treat react.runtime as an enum of exactly 'classic' and 'automatic'; document it in your config schema","Map Babel-style transform names ('react-jsx', 'automatic-runtime') to 'automatic' before forwarding to flow","Fail fast on unknown config keys/values at your config boundary instead of letting flow panic later"],"tags":["config","react","jsx-transform","validation","flow-js"],"backgroundTag":"unsupported-config-value","analyzedSha":"f88ac94bcf6992f5d5a158854d94613ebb92c6e6","analyzedAt":"2026-08-20T10:41:37.992Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}