{"record":{"id":"6098a50bbbe768d1","repo":"swc-project/swc","slug":"the-requested-module-specifier-does-not-provid","errorCode":null,"errorMessage":"The requested module '{specifier}' does not provide an export named '{export_name}'","messagePattern":"The requested module '(.+?)' does not provide an export named '(.+?)'","errorType":"exception","errorClass":"SyntaxError","httpStatus":null,"severity":"error","filePath":"bindings/binding_nodejs_support_wasm/src/nodejs.rs","lineNumber":590,"sourceCode":"\nfn await_import(\n    code: &str,\n    specifier: &str,\n    with: Option<&ObjectLit>,\n    required_exports: &[String],\n) -> String {\n    let mut out = format!(\"{DYNAMIC_IMPORT_NAME}({}\", json_string(specifier));\n    if let Some(options) = import_options_to_dynamic_options(code, with) {\n        out.push_str(\", \");\n        out.push_str(&options);\n    }\n    out.push(')');\n    if !required_exports.is_empty() {\n        out.push_str(\".then((m) => { \");\n        for export_name in required_exports {\n            out.push_str(\"if (!(\");\n            out.push_str(&json_string(export_name));\n            out.push_str(\" in m)) throw new SyntaxError(\");\n            out.push_str(&json_string(&format!(\n                \"The requested module '{specifier}' does not provide an export named \\\n                 '{export_name}'\"\n            )));\n            out.push_str(\"); \");\n        }\n        out.push_str(\"return m; })\");\n    }\n    out\n}\n\nfn import_options_to_dynamic_options(code: &str, with: Option<&ObjectLit>) -> Option<String> {\n    let attributes = slice_span(code, with?.span)?;\n    Some(format!(\"{{ with: {attributes} }}\"))\n}\n\nfn default_declaration_needs_parentheses(decl: &DefaultDecl) -> bool {\n    matches!(decl, DefaultDecl::Class(class) if class.ident.is_none())","sourceCodeStart":572,"sourceCodeEnd":608,"githubUrl":"https://github.com/swc-project/swc/blob/d7d74346665e36e692aa07e13d4ee3ee692ee35c/bindings/binding_nodejs_support_wasm/src/nodejs.rs#L572-L608","documentation":"Error \"The requested module '{specifier}' does not provide an export named '{export_name}'\" thrown in swc-project/swc.","triggerScenarios":"Thrown at bindings/binding_nodejs_support_wasm/src/nodejs.rs:590 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":"d7d74346665e36e692aa07e13d4ee3ee692ee35c","analyzedAt":"2026-08-16T12:41:13.160Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}