{"record":{"id":"7ea4067803db635d","repo":"d2lang/d2","slug":"failed-to-decompress-sourcecodepro-bold-v","errorCode":null,"errorMessage":"Failed to decompress SourceCodePro-Bold: %v","messagePattern":"Failed to decompress SourceCodePro-Bold: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"d2renderers/d2fonts/d2fonts_embed_wasm.go","lineNumber":86,"sourceCode":"\t} else {\n\t\tFontEncodings.Set(Font{Family: SourceSansPro, Style: FONT_STYLE_SEMIBOLD}, str)\n\t}\n\n\tif str, err := compression.DecompressBrotli(sourceSansProItalicBr); err != nil {\n\t\tpanic(fmt.Sprintf(\"Failed to decompress SourceSansPro-Italic: %v\", err))\n\t} else {\n\t\tFontEncodings.Set(Font{Family: SourceSansPro, Style: FONT_STYLE_ITALIC}, str)\n\t}\n\n\t// Decompress and register SourceCodePro fonts\n\tif str, err := compression.DecompressBrotli(sourceCodeProRegularBr); err != nil {\n\t\tpanic(fmt.Sprintf(\"Failed to decompress SourceCodePro-Regular: %v\", err))\n\t} else {\n\t\tFontEncodings.Set(Font{Family: SourceCodePro, Style: FONT_STYLE_REGULAR}, str)\n\t}\n\n\tif str, err := compression.DecompressBrotli(sourceCodeProBoldBr); err != nil {\n\t\tpanic(fmt.Sprintf(\"Failed to decompress SourceCodePro-Bold: %v\", err))\n\t} else {\n\t\tFontEncodings.Set(Font{Family: SourceCodePro, Style: FONT_STYLE_BOLD}, str)\n\t}\n\n\tif str, err := compression.DecompressBrotli(sourceCodeProSemiboldBr); err != nil {\n\t\tpanic(fmt.Sprintf(\"Failed to decompress SourceCodePro-Semibold: %v\", err))\n\t} else {\n\t\tFontEncodings.Set(Font{Family: SourceCodePro, Style: FONT_STYLE_SEMIBOLD}, str)\n\t}\n\n\tif str, err := compression.DecompressBrotli(sourceCodeProItalicBr); err != nil {\n\t\tpanic(fmt.Sprintf(\"Failed to decompress SourceCodePro-Italic: %v\", err))\n\t} else {\n\t\tFontEncodings.Set(Font{Family: SourceCodePro, Style: FONT_STYLE_ITALIC}, str)\n\t}\n\n\t// Decompress and register FuzzyBubbles fonts\n\tif str, err := compression.DecompressBrotli(fuzzyBubblesRegularBr); err != nil {","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/d2lang/d2/blob/0d69dca6f532ceaeacd615d35d1eaa41a238ffdb/d2renderers/d2fonts/d2fonts_embed_wasm.go#L68-L104","documentation":"init()-time panic in the wasm d2fonts package when the embedded brotli-compressed SourceCodePro Bold font fails to decompress, preventing registration of the bold monospace face and aborting module load.","triggerScenarios":"Package init of the wasm build when compression.DecompressBrotli(sourceCodeProBoldBr) errors — typically a broken embedded asset in a custom or corrupted build.","commonSituations":"Regenerated .br assets with incompatible settings; bundler/build corruption of embedded binaries; incomplete git-lfs style checkouts of binary assets.","solutions":["Standalone-decompress sourceCodeProBoldBr to confirm validity","Regenerate the bold .br asset and rebuild the wasm module","Rebuild from clean upstream sources","Check that the brotli compressor settings (e.g. quality/window) match what DecompressBrotli expects"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"if _, err := compression.DecompressBrotli(sourceCodeProBoldBr); err != nil {\n    return fmt.Errorf(\"broken embedded SourceCodePro-Bold asset: %w\", err)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Regenerate all font .br assets together","Validate assets in CI before publishing","Keep brotli toolchain versions consistent","Rebuild from clean checkouts"],"tags":["wasm","fonts","brotli","init-panic"],"backgroundTag":"brotli-decompression-failed","analyzedSha":"0d69dca6f532ceaeacd615d35d1eaa41a238ffdb","analyzedAt":"2026-08-31T12:19:21.182Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}