{"record":{"id":"d4f852489d5de354","repo":"swc-project/swc","slug":"unsupported","errorCode":"unsupported","errorMessage":"emit unknown variant is not supported","messagePattern":"emit unknown variant is not supported","errorType":"exception","errorClass":"io::Error","httpStatus":null,"severity":"error","filePath":"crates/swc_ecma_codegen/src/lib.rs","lineNumber":2569,"sourceCode":"    fn emit(&mut self, emitter: &mut Macro) -> Result {\n        emitter.emit_ident_like(self.span, &self.sym, self.optional)?;\n\n        Ok(())\n    }\n}\n\n#[node_impl]\nimpl MacroNode for IdentName {\n    fn emit(&mut self, emitter: &mut Macro) -> Result {\n        emitter.emit_ident_like(self.span, &self.sym, false)?;\n\n        Ok(())\n    }\n}\n\n#[cfg(swc_ast_unknown)]\nfn unknown_error() -> io::Error {\n    io::Error::new(\n        io::ErrorKind::Unsupported,\n        \"emit unknown variant is not supported\",\n    )\n}\n","sourceCodeStart":2551,"sourceCodeEnd":2574,"githubUrl":"https://github.com/swc-project/swc/blob/5176682b65416c6b5de6b47379ae1588ea3ecb3f/crates/swc_ecma_codegen/src/lib.rs#L2551-L2574","documentation":"Sentinel io::Error (ErrorKind::Unsupported) returned by the codegen when the swc_ast_unknown cfg is enabled and the AST contains an 'unknown' variant node that the emitter has no rendering rule for. It fires at emit time, meaning the input AST was constructed from a newer/unknown syntax variant.","triggerScenarios":"Thrown at crates/swc_ecma_codegen/src/lib.rs:2569 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the parser/compiler that produced the AST and the codegen crate share the same swc_ecma_ast version so no unknown variants exist","Handle io::ErrorKind::Unsupported at the call site and report it as an unsupported-syntax error to the user","Do not enable the swc_ast_unknown cfg in builds that must serialize arbitrary ASTs"],"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-14T00:17:10.932Z"}