728x90
🚨상황
Invalid src prop (https://image.tmdb.org/t/p/w185/9BJxdhi4tuiQdgT8bfDuiPipnsx.jpg)
on `next/image`, hostname "image.tmdb.org" is not configured under images in your `next.config.js`
원인
외부 이미지에 대한 호스트가 구성되지 않았다.
해결법
next.config.js 파일을 생성하여 외부에서 불러올 이미지에 해당하는 hostname을 작성해준다.
(아래 코드는 Next.js 14버전 기준으로 작성되었습니다.)
// next.config.js
module.exports = {
images: {
remotePatterns: [
{
protocol: "https",
hostname: "image.tmdb.org",
},
],
},
};
<참고자료>
https://nextjs.org/docs/messages/next-image-unconfigured-host
`next/image` Un-configured Host
Using App Router Features available in /app
nextjs.org
728x90
'LANGUAGE > React' 카테고리의 다른 글
[Next.js] TMDB Movie Collection 가져오기/ 영화 컬렉션, 시리즈 가져오는 법 (0) | 2024.06.27 |
---|---|
[Next.js] Next.js/React 에 Font Awesome Icon 적용하기/ 아이콘 추가하는 법 (0) | 2024.06.19 |
[React] 클래스형 컴포넌트의 생명주기(life cycle) (0) | 2024.06.05 |
[React] 실전형 리액트 Hooks 10 (0) | 2024.06.04 |
[React] npm start 오류 / npm start 명령어 안됨 (0) | 2024.05.29 |