프론트엔드/Next.js
images.domains 에러
0-SIK
2024. 4. 16. 21:20
728x90
images.domains 에러
The "images.domains" configuration is deprecated. Please use "images.remotePatterns" configuration instead.
경고 메시지는 "images.domains" 설정이 더 이상 권장되지 않으며 대신 "images.remotePatterns" 설정을 사용하라고 알려주고 있습니다.
In Next.js Version 14, domains configuration has been deprecated in favour of remotePatterns. This can be defined in the next.config.js file.
Here is a reference as per the Next.js docs: remotePatterns
In your snippet, after you remove the domains configuration as you have described, it seems that you have mixed up your values in remotePatterns configuration, because you have set the hostname value to the wildcard '**' instead of the actual hostname 'res.cloudinary.com', thus the error hostname "res.cloudinary.com" is not configured.
Next.js 버전 14에서는 도메인 구성이 더 이상 사용되지 않고 RemotePatterns를 사용합니다. 이는 next.config.js 파일에서 정의할 수 있습니다.
귀하의 스니펫에서 설명한 대로 도메인 구성을 제거한 후 호스트 이름 값을 실제 호스트 이름 'res' 대신 와일드카드 '**'로 설정했기 때문에 원격 패턴 구성의 값이 혼합된 것 같습니다. cloudinary.com'이므로 호스트 이름 "res.cloudinary.com" 오류가 구성되지 않았습니다.
Try to do this instead:
images: { remotePatterns: [ { protocol: 'https', hostname: 'res.cloudinary.com', pathname: '**', }, ], },
[출처]바로가기
728x90