{"record":{"id":"5f8525a5ece1ccc1","repo":"d2lang/d2","slug":"failed-to-decompress-fuzzybubbles-regular-v","errorCode":null,"errorMessage":"Failed to decompress FuzzyBubbles-Regular: %v","messagePattern":"Failed to decompress FuzzyBubbles-Regular: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"d2renderers/d2fonts/d2fonts_embed_wasm.go","lineNumber":105,"sourceCode":"\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}\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","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/d2lang/d2/blob/0d69dca6f532ceaeacd615d35d1eaa41a238ffdb/d2renderers/d2fonts/d2fonts_embed_wasm.go#L87-L123","documentation":"During WASM init, d2fonts decompresses the embedded FuzzyBubbles-Regular brotli blob to register the HandDrawn regular (and italic fallback) font. Failure decompressing that blob panics init with this message. The font is embedded at build time, so failures indicate bad/corrupt embedded data rather than user input.","triggerScenarios":"Process start of a WASM build: init at d2renderers/d2fonts/d2fonts_embed_wasm.go:105 calls compression.DecompressBrotli(fuzzyBubblesRegularBr) and gets a non-nil error — corrupt, truncated, or invalid embedded brotli data.","commonSituations":"Regenerating embedded font assets with wrong compression settings; corrupted repo files; build pipeline substituting placeholder/empty blobs; incompatibility between brotli encoder and decoder versions.","solutions":["Rebuild from a clean checkout to regenerate/restore the embedded fuzzyBubblesRegular blob","Verify fuzzyBubblesRegularBr decompresses standalone (brotli -d) and replace it if corrupt","Re-encode the FuzzyBubbles-Regular TTF to brotli with the same encoder settings the project uses","Check that the compression package's brotli decoder version is compatible with the asset encoder"],"exampleFix":"// before\nfuzzyBubbles-regular.ttf.br // empty/invalid\n// after\nbrotli -f fuzzyBubbles-regular.ttf && go build ./...","handlingStrategy":"validation","validationCode":"// Validate embedded asset pre-build\nimport \"os/exec\"\nout, err := exec.Command(\"brotli\", \"-d\", \"-c\", \"fuzzyBubbles-regular.ttf.br\").Output()\nif err != nil || len(out) == 0 { panic(\"fuzzyBubbles-regular.ttf.br is corrupt\") }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run asset integrity tests in CI (decompress all embedded blobs)","Regenerate .br assets only with the project's documented pipeline","Verify file sizes/checksums after merges involving font assets"],"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-08-31T14:17:45.589Z"}