{"record":{"id":"85662ddfcf807ebd","repo":"d2lang/d2","slug":"failed-to-decompress-sourcecodepro-semibold-v","errorCode":null,"errorMessage":"Failed to decompress SourceCodePro-Semibold: %v","messagePattern":"Failed to decompress SourceCodePro-Semibold: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"d2renderers/d2fonts/d2fonts_embed_wasm.go","lineNumber":92,"sourceCode":"\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 {\n\t\tpanic(fmt.Sprintf(\"Failed to decompress FuzzyBubbles-Regular: %v\", err))\n\t} else {\n\t\tFontEncodings.Set(Font{Family: HandDrawn, Style: FONT_STYLE_REGULAR}, str)\n\t\t// HandDrawn has no italic, so reuse regular\n\t\tFontEncodings.Set(Font{Family: HandDrawn, Style: FONT_STYLE_ITALIC}, str)\n\t}","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/d2lang/d2/blob/0d69dca6f532ceaeacd615d35d1eaa41a238ffdb/d2renderers/d2fonts/d2fonts_embed_wasm.go#L74-L110","documentation":"init()-time panic in the wasm d2fonts package when the embedded brotli-compressed SourceCodePro Semibold font fails to decompress. The last of the registered font faces; a failure aborts the entire wasm module during initialization.","triggerScenarios":"Package init of the wasm build when compression.DecompressBrotli(sourceCodeProSemiboldBr) returns an error — corrupt, empty, or toolchain-incompatible embedded brotli blob.","commonSituations":"Custom wasm builds with mis-generated semibold asset; corrupted embedded binaries from build tooling; brotli version mismatch after regenerating fonts.","solutions":["Verify sourceCodeProSemiboldBr with a standalone brotli decompressor","Regenerate the semibold .br asset via the project's embed script","Rebuild the wasm module from a clean upstream checkout","Ensure compression toolchain matches the decompressor expectations"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"if _, err := compression.DecompressBrotli(sourceCodeProSemiboldBr); err != nil {\n    return fmt.Errorf(\"broken embedded SourceCodePro-Semibold 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"}