{"record":{"id":"3b6779dd29815ffd","repo":"swc-project/swc","slug":"corejs-version-other-than-2-3","errorCode":null,"errorMessage":"corejs version other than 2 / 3","messagePattern":"corejs version other than 2 / 3","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/swc_ecma_preset_env/src/lib.rs","lineNumber":458,"sourceCode":"            Some(Mode::Usage) => {\n                let mut r = match self.corejs {\n                    Version { major: 2, .. } => {\n                        let mut v = corejs2::UsageVisitor::new(self.targets.clone());\n                        m.visit_with(&mut v);\n\n                        v.required\n                    }\n                    Version { major: 3, .. } => {\n                        let mut v = corejs3::UsageVisitor::new(\n                            self.targets.clone(),\n                            self.shipped_proposals,\n                            self.corejs,\n                        );\n                        m.visit_with(&mut v);\n                        v.required\n                    }\n\n                    _ => unimplemented!(\"corejs version other than 2 / 3\"),\n                };\n\n                if regenerator::is_required(m) {\n                    r.insert(\"regenerator-runtime/runtime.js\");\n                }\n\n                r\n            }\n            Some(Mode::Entry) => match self.corejs {\n                Version { major: 2, .. } => {\n                    let mut v = corejs2::Entry::new(self.targets.clone(), self.regenerator);\n                    m.visit_mut_with(&mut v);\n                    v.imports\n                }\n\n                Version { major: 3, .. } => {\n                    let mut v =\n                        corejs3::Entry::new(self.targets.clone(), self.corejs, !self.regenerator);","sourceCodeStart":440,"sourceCodeEnd":476,"githubUrl":"https://github.com/swc-project/swc/blob/5176682b65416c6b5de6b47379ae1588ea3ecb3f/crates/swc_ecma_preset_env/src/lib.rs#L440-L476","documentation":"preset_env's usage-mode polyfill collection only supports core-js major versions 2 and 3; a `corejs` config value with any other major version reaches collect() and trips this arm. It signals a misconfigured preset-env option, not bad input code.","triggerScenarios":"Thrown at crates/swc_ecma_preset_env/src/lib.rs:458 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set the corejs option to a 2.x or 3.x version in the preset-env config","Validate the configured corejs version against the supported set before running the transform","Omit corejs (or use Mode::Entry) if no usage-based polyfill injection is needed"],"exampleFix":null,"handlingStrategy":"validation","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"}