Is it expected that if a composeResource file fails to load on wasmJs/js, it will completely stop composition and kill the ui?
Dunno if there is a safer way to handle resource loading? Minus pre caching everything which seems a little heavy handed?
f
Fudge
08/02/2025, 10:36 AM
Could you wrap resource accesses with try/catch?
s
Stefan Oltmann
08/03/2025, 3:34 AM
No try/catch inside composables unfortunately.
But normally it doesn’t fail.
m
Michael Paus
08/03/2025, 10:11 AM
“But normally it doesn’t fail.” Famous last words for software developers 😉.
😄 1
f
Fudge
08/04/2025, 8:42 AM
You can load the resource yourself and use coil and wrap it with try/catch, that's what I do. If it fails I put in a missing texture image.
I also have a way of restarting Compose entirely in case it fails but that requires a very special setup