{"record":{"id":"60c3a5c23dd0461d","repo":"d2lang/d2","slug":"failed-to-decompress-fuzzybubbles-bold-v","errorCode":null,"errorMessage":"Failed to decompress FuzzyBubbles-Bold: %v","messagePattern":"Failed to decompress FuzzyBubbles-Bold: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"d2renderers/d2fonts/d2fonts_embed_wasm.go","lineNumber":113,"sourceCode":"\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}\n\n\tif str, err := compression.DecompressBrotli(fuzzyBubblesBoldBr); err != nil {\n\t\tpanic(fmt.Sprintf(\"Failed to decompress FuzzyBubbles-Bold: %v\", err))\n\t} else {\n\t\tFontEncodings.Set(Font{Family: HandDrawn, Style: FONT_STYLE_BOLD}, str)\n\t\t// HandDrawn has no semibold, so reuse bold\n\t\tFontEncodings.Set(Font{Family: HandDrawn, Style: FONT_STYLE_SEMIBOLD}, str)\n\t}\n\n\t// Trim trailing newlines\n\ttrimEncodings()\n\n\t// Initialize FontFaces with TTF files\n\tif err := initializeFontFaces(fontFacesFS); err != nil {\n\t\tpanic(fmt.Sprintf(\"Failed to initialize font faces: %v\", err))\n\t}\n}\n\n// trimEncodings removes trailing newlines from all font encodings\nfunc trimEncodings() {\n\tFontEncodings.Range(func(k Font, v string) bool {","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/d2lang/d2/blob/0d69dca6f532ceaeacd615d35d1eaa41a238ffdb/d2renderers/d2fonts/d2fonts_embed_wasm.go#L95-L131","documentation":"During WASM init, d2fonts decompresses the embedded FuzzyBubbles-Bold brotli blob to register the HandDrawn bold (and semibold fallback) font. If compression.DecompressBrotli fails, init panics with this message. This is an embedded-asset integrity failure, not a runtime API misuse.","triggerScenarios":"Process start of a WASM build: init at d2renderers/d2fonts/d2fonts_embed_wasm.go:113 calls compression.DecompressBrotli(fuzzyBubblesBoldBr) and the error is non-nil — corrupt, truncated, or invalid brotli bytes in the embedded asset.","commonSituations":"Corrupted repository asset after bad merge/checkout; build step that regenerates .br assets failing silently; encoder/decoder version mismatch; disk or VCS truncation of the blob.","solutions":["Rebuild from a clean checkout so the embedded fuzzyBubblesBold blob is intact","Verify the .br blob decompresses standalone and replace it if corrupt","Regenerate the brotli asset from the FuzzyBubbles-Bold TTF using the project's asset pipeline","Align the brotli library versions used for encoding assets and decoding at runtime"],"exampleFix":"// before\nfuzzyBubbles-bold.ttf.br // truncated\ngit checkout -- d2renderers/d2fonts/assets/\n// after\ngit checkout -- d2renderers/d2fonts/assets/ && go build","handlingStrategy":"validation","validationCode":"// Pre-build integrity check\nb, _ := os.ReadFile(\"d2renderers/d2fonts/assets/fuzzyBubbles-bold.ttf.br\")\nif _, err := compression.DecompressBrotli(b); err != nil {\n    panic(\"fuzzyBubbles-bold.ttf.br is corrupt: \" + err.Error())\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Checksum-verify .br assets in CI","Avoid partial checkouts/submodule drift; use clean builds","Document and reuse the single asset-compression script"],"tags":["go","panic","init","wasm","brotli","embedded-assets"],"backgroundTag":"brotli-decompression-failed","analyzedSha":"0d69dca6f532ceaeacd615d35d1eaa41a238ffdb","analyzedAt":"2026-08-31T12:19:21.182Z","schemaVersion":2},"datasetVersion":"2026-09-01T08:17:40.651Z"}