Next.js 15 – Fallback for failed external <Image> loads?
Answered
Snowshoe posted this in #help-forum
SnowshoeOP
Using Next.js 15 and the <Image> component with unoptimized. How can I show a fallback image (like a default icon) when the external src fails to load, instead of just showing the alt text? Should this be handled client-side with onError, or is there a better way?
1 Reply
@Snowshoe Using Next.js 15 and the <Image> component with unoptimized. How can I show a fallback image (like a default icon) when the external src fails to load, instead of just showing the alt text? Should this be handled client-side with onError, or is there a better way?
yes, handled client side with onError
Answer