I know it's a timing issue, but there's a way to avoid the 404 on console using example 1? .default() is not an option
It's mandatory to use a full path on db?
Tried some ternary operation but no luck..
Example 1 should work; I use this pattern in all my projects. If you check the Demo Dynamic Real Estate Site, you’ll see the same usage: <img alt='Property Image' dmx-bind:src="Photo">
The 404 you’re seeing usually means the filename is empty on first render, so the browser tries to load assets/images/ before the data arrives.
Try wrapping the <img> in a conditional so it only renders when the filename exists. Something like: