{"record":{"id":"b28008de635e85ed","repo":"swc-project/swc","slug":"swc-currently-does-not-support-importing-typescrip","errorCode":null,"errorMessage":"swc currently does not support importing typescript module from babel","messagePattern":"swc currently does not support importing typescript module from babel","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/swc_estree_compat/src/swcify/typescript.rs","lineNumber":100,"sourceCode":"    }\n}\n\nimpl Swcify for TSTypeAnnotation {\n    type Output = TsTypeAnn;\n\n    fn swcify(self, ctx: &Context) -> Self::Output {\n        TsTypeAnn {\n            span: ctx.span(&self.base),\n            type_ann: self.type_annotation.swcify(ctx),\n        }\n    }\n}\n\nimpl Swcify for TSType {\n    type Output = Box<TsType>;\n\n    fn swcify(self, _: &Context) -> Self::Output {\n        todo!(\"swc currently does not support importing typescript module from babel\")\n    }\n}\n\nimpl Swcify for SuperTypeParams {\n    type Output = TsTypeParamInstantiation;\n\n    fn swcify(self, ctx: &Context) -> Self::Output {\n        match self {\n            SuperTypeParams::Flow(_) => unimplemented!(\"flow type\"),\n            SuperTypeParams::TS(v) => v.swcify(ctx),\n        }\n    }\n}\n\nimpl Swcify for Access {\n    type Output = Accessibility;\n\n    fn swcify(self, _: &Context) -> Self::Output {","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/swc-project/swc/blob/5176682b65416c6b5de6b47379ae1588ea3ecb3f/crates/swc_estree_compat/src/swcify/typescript.rs#L82-L118","documentation":"A todo!() stub in `Swcify for TSType` (swcify/typescript.rs:100). Converting Babel's TS types back into swc TypeScript nodes is not implemented in this path — the whole impl is a placeholder that unconditionally panics when any TSType node is swcified. It fires whenever the Babel input contains TypeScript type annotations whose types must be converted back to swc AST, marking a known unimplemented conversion area rather than a bad input.","triggerScenarios":"Thrown at crates/swc_estree_compat/src/swcify/typescript.rs:100 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Avoid the swcify path for TypeScript-heavy Babel ASTs until TSType conversion is implemented","Contribute the TSType-to-TsType mapping arms to swc_estree_compat","Strip type annotations before conversion if downstream only needs the JS skeleton"],"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"}