Image is often missing on first render on Safari iOS

Author: DanielStout5Created Jun 25, 2020Updated Jul 4, 2025

I'm using domtoimage.toPng(element) where element contains a few different elements, including a .png img that has partial transparency.

That img is missing from the resulting data URL on the first call on iPhones. Subsequent calls do include the img. There are two other img inside element that always show up in every toPng result, including the first one. Those other .pngs have transparency as well, but it isn't partial - they are either fully opaque text on a fully transparent background.