Next.js Discord

Discord Forum

Next.js 15 – Fallback for failed external <Image> loads?

Answered
Snowshoe posted this in #help-forum
Open in Discord
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?
Answered by joulev
yes, handled client side with onError
View full answer

1 Reply