KamoCRM

Stop racing hydration with a 404 — render the logo URL that actually exists

Fixkamolos
Shipped
18 மே, 2026 அன்று 5:01 AM UTC
Author
Kamo
Commit
3204436

The tenant MinIO bucket holds logo-full.svg / logo.svg as canonical names; nobody uploads the -on-dark variants. We were trying the dark-mode URL first, 404'ing in the browser before React hydration attached the onError handler, then sitting on a broken-image because the load event had already fired and been lost. Drop the -on-dark probe so the first src is the real URL, and add a mount-time check: if the SSR-rendered img is already complete with naturalWidth=0, advance the candidate index — covers any future case where the first URL legitimately fails before hydration.

All changes

Like what you see shipping?

All of it arrives in your workspace on its own. Start on the free plan and read this page again in a month.

Start Free ForeverView Pricing