I understand that when using Next.js image components without TypeScript, the URL must be configured in next.config.js
, but I'm unsure why this doesn't work with TypeScript.
..., is not set up under images in your
next.config.js
. Learn more here: https://nextjs.org/docs/messages/next-image-unconfigured-host
What's the solution? Do I have to resort to using a regular img
tag?
image component:
<Image
src="https://images.unsplash.com/photo-1621794279356-0150106a4b45?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1"
alt="blog title"
width="100"
height="100"
/>
next.config.ts
export const images = {
domains: [
"images.unsplash.com"
],
};