반응형
Error: Invalid src prop "(domains)" on `next/image` 해결방법
Next.js, Nextra에서 외부에서 이미지 파일을 불러오면 아래와 같은 Error가 발생한다.
위와 같은 Error는 next.config.js에 domain을 설정해주면 된다.
module.exports = {
reactStrictMode: true,
images: {
domains: [
"www.notion.so",
"s3.us-west-2.amazonaws.com",
], // 이곳에 에러에서 hostname 다음 따옴표에 오는 링크를 적으면 되고 배열로 여러가지 입력이 가능하다.
}
}
이후 next.config 파일을 수정했기 때문에 서버를 껐다가 다시 켜면 정상적으로 동작한다.
반응형
댓글