Showing images without defining remote patterns
Unanswered
Tropical Parula posted this in #help-forum
Tropical ParulaOP
I'm using the Spotify API to show a user all their playlists along with the images of those playlists. These images are hosted on several different cdns which I can't know beforehand, so when I try to show them in an
Is there any way to display external images in an
<Image />-component I get a runtime error that says that the hostname is not configured in my next.config.js.Is there any way to display external images in an
<Image /> without having to add the hostnames in config, or should I just use regular <img /> instead?2 Replies
@Tropical Parula I'm using the Spotify API to show a user all their playlists along with the images of those playlists. These images are hosted on several different cdns which I can't know beforehand, so when I try to show them in an `<Image />`-component I get a runtime error that says that the hostname is not configured in my `next.config.js`.
Is there any way to display external images in an `<Image />` without having to add the hostnames in config, or should I just use regular `<img />` instead?
even if it is possible to allow all URLs, you absolutely should not do so for reasons specified in https://nextjs-forum.com/post/1128918642646597703
if you cannot know what to put in
remotePatterns at all, use <img>