{"record":{"id":"e884d16c3af2e667","repo":"oven-sh/bun","slug":"failed-to-compile-mdx","errorCode":null,"errorMessage":"Failed to compile MDX: {:?}","messagePattern":"Failed to compile MDX: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"packages/bun-build-mdx-rs/src/lib.rs","lineNumber":20,"sourceCode":"use mdxjs::{compile, Options as CompileOptions};\nuse napi_derive::napi;\n\ndefine_bun_plugin!(\"bun-mdx-rs\");\n\n#[bun]\npub fn bun_mdx_rs(handle: &mut OnBeforeParse) -> Result<()> {\n  let source_str = handle.input_source_code()?;\n\n  let mut options = CompileOptions::gfm();\n\n  // Leave it as JSX for Bun to handle\n  options.jsx = true;\n\n  let path = handle.path()?;\n  options.filepath = Some(path.to_string());\n\n  let jsx = compile(&source_str, &options)\n    .map_err(|e| anyhow::anyhow!(\"Failed to compile MDX: {:?}\", e))?;\n\n  handle.set_output_source_code(jsx, BunLoader::BUN_LOADER_JSX);\n\n  Ok(())\n}\n","sourceCodeStart":2,"sourceCodeEnd":26,"githubUrl":"https://github.com/oven-sh/bun/blob/8c5296ac459e8252d3cd702f3fbcbb0c249d95d5/packages/bun-build-mdx-rs/src/lib.rs#L2-L26","documentation":"Error \"Failed to compile MDX: {:?}\" thrown in oven-sh/bun.","triggerScenarios":"Thrown at packages/bun-build-mdx-rs/src/lib.rs:20 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"}