{"record":{"id":"b0dceeeaa11de852","repo":"swc-project/swc","slug":"codegen-of-export-default-from-foo","errorCode":null,"errorMessage":"codegen of `export default from 'foo';`","messagePattern":"codegen of `export default from 'foo';`","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/swc_ecma_codegen/src/module_decls.rs","lineNumber":263,"sourceCode":"            space!(emitter);\n            keyword!(emitter, \"as\");\n            space!(emitter);\n        }\n\n        emit!(self.local);\n\n        srcmap!(emitter, self, false);\n\n        Ok(())\n    }\n}\n\n#[node_impl]\nimpl MacroNode for ExportSpecifier {\n    fn emit(&mut self, emitter: &mut Macro) -> Result {\n        match self {\n            ExportSpecifier::Default(..) => {\n                unimplemented!(\"codegen of `export default from 'foo';`\")\n            }\n            ExportSpecifier::Namespace(ref node) => emit!(node),\n            ExportSpecifier::Named(ref node) => emit!(node),\n            #[cfg(swc_ast_unknown)]\n            _ => return Err(unknown_error()),\n        }\n\n        Ok(())\n    }\n}\n\n#[node_impl]\nimpl MacroNode for ExportNamespaceSpecifier {\n    fn emit(&mut self, emitter: &mut Macro) -> Result {\n        emitter.emit_leading_comments_of_span(self.span(), false)?;\n\n        srcmap!(emitter, self, true);\n","sourceCodeStart":245,"sourceCodeEnd":281,"githubUrl":"https://github.com/swc-project/swc/blob/5176682b65416c6b5de6b47379ae1588ea3ecb3f/crates/swc_ecma_codegen/src/module_decls.rs#L245-L281","documentation":"The code generator hit ExportSpecifier::Default, the AST node produced by non-standard `export default from '...'` syntax, and deliberately panics via unimplemented! because no JS output is implemented for that variant. It fires whenever such a specifier reaches emit — the input reached the parser but the codegen pass has no lowering for it.","triggerScenarios":"Thrown at crates/swc_ecma_codegen/src/module_decls.rs:263 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Guard against ExportSpecifier::Default before emitting and lower it to a form codegen supports (e.g. a named re-export of the default binding)","Avoid source syntax that produces `export default from ...` until codegen support lands","Implement the emit arm for ExportSpecifier::Default in swc_ecma_codegen"],"exampleFix":null,"handlingStrategy":"type-guard","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-23T08:17:48.524Z"}