{"record":{"id":"4dd296f8a6007781","repo":"swc-project/swc","slug":"swc-does-not-support-flow-types","errorCode":null,"errorMessage":"swc does not support flow types","messagePattern":"swc does not support flow types","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/swc_estree_compat/src/swcify/typescript.rs","lineNumber":29,"sourceCode":"use super::Context;\nuse crate::{swcify::Swcify, Never};\n\nimpl Swcify for TSTypeParameterInstantiation {\n    type Output = TsTypeParamInstantiation;\n\n    fn swcify(self, ctx: &Context) -> Self::Output {\n        TsTypeParamInstantiation {\n            span: ctx.span(&self.base),\n            params: self.params.swcify(ctx),\n        }\n    }\n}\n\nimpl Swcify for FlowType {\n    type Output = Never;\n\n    fn swcify(self, _: &Context) -> Self::Output {\n        unreachable!(\"swc does not support flow types\")\n    }\n}\n\nimpl Swcify for TypeParamDeclOrNoop {\n    type Output = Option<TsTypeParamDecl>;\n\n    fn swcify(self, ctx: &Context) -> Self::Output {\n        match self {\n            TypeParamDeclOrNoop::Flow(_) => None,\n            TypeParamDeclOrNoop::TS(v) => Some(v.swcify(ctx)),\n            TypeParamDeclOrNoop::Noop(_) => None,\n        }\n    }\n}\n\nimpl Swcify for TSTypeParameterDeclaration {\n    type Output = TsTypeParamDecl;\n","sourceCodeStart":11,"sourceCodeEnd":47,"githubUrl":"https://github.com/swc-project/swc/blob/5176682b65416c6b5de6b47379ae1588ea3ecb3f/crates/swc_estree_compat/src/swcify/typescript.rs#L11-L47","documentation":"An unreachable!() stub in `Swcify for FlowType` (swcify/typescript.rs:29). Babel's type AST is unified across TypeScript and Flow, so a FlowType node can appear in the type slot; swc only supports TypeScript, and there is no swc AST node for Flow types. The impl returns `Never` and panics whenever a Flow type annotation (from a .js file parsed with Flow syntax) is converted to swc. The FlowType node is the input at fault.","triggerScenarios":"Thrown at crates/swc_estree_compat/src/swcify/typescript.rs:29 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reject Flow-typed input files before swcification with a clear 'Flow types are not supported' error","Strip Flow type annotations (e.g. via flow-remove-types) before converting the AST","Ensure the Babel parser config uses TypeScript syntax, not Flow, when generating input for swcify"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5176682b65416c6b5de6b47379ae1588ea3ecb3f","analyzedAt":"2026-08-17T16:16:52.067Z","contentChangedAt":"2026-08-17T16:16:52.067Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}