{"record":{"id":"8074b89bb443eb2a","repo":"oven-sh/bun","slug":"unexpected-type-in-source-file","errorCode":null,"errorMessage":"Unexpected type in source file {}","messagePattern":"Unexpected type in source file (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/bundler/linker_context/convertStmtsForChunk.rs","lineNumber":553,"sourceCode":"                                        // \"export default class {}\" => \"class default {}\"\n                                        // \"export default class foo {}\" => \"class foo {}\"\n\n                                        // Be careful to not modify the original statement\n                                        stmt = Stmt::alloc(\n                                            S::Class {\n                                                // SAFETY: shallow bitwise copy of arena-backed E::Class.\n                                                class: unsafe {\n                                                    core::ptr::read(&raw const s2.class)\n                                                },\n                                                is_export: false,\n                                            },\n                                            stmt.loc,\n                                        );\n                                        stmt.data.s_class_mut().unwrap().class.class_name =\n                                            Some(s.default_name);\n                                    }\n\n                                    _ => unreachable!(\n                                        \"Unexpected type in source file {}\",\n                                        bstr::BStr::new(\n                                            &c.parse_graph()\n                                                .input_files\n                                                .get(\n                                                    c.graph\n                                                        .files\n                                                        .get(source_index as usize)\n                                                        .input_file\n                                                        .get()\n                                                        as usize\n                                                )\n                                                .source\n                                                .path\n                                                .text\n                                        ),\n                                    ),\n                                }","sourceCodeStart":535,"sourceCodeEnd":571,"githubUrl":"https://github.com/oven-sh/bun/blob/8c5296ac459e8252d3cd702f3fbcbb0c249d95d5/src/bundler/linker_context/convertStmtsForChunk.rs#L535-L571","documentation":"Error \"Unexpected type in source file {}\" thrown in oven-sh/bun.","triggerScenarios":"Thrown at src/bundler/linker_context/convertStmtsForChunk.rs:553 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8c5296ac459e8252d3cd702f3fbcbb0c249d95d5","analyzedAt":"2026-08-16T08:01:58.794Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}