Published 2024. 6. 20. 11:44
warn-once.js:16 Image with src "/main-logo.svg" was detected as the Largest Contentful Paint (LCP). Please add the "priority" property if this image is above the fold.
Read more: https://nextjs.org/docs/api-reference/next/image#priority
https://nextjs.org/docs/pages/api-reference/components/image#priority
Components: <Image> | Next.js
Optimize Images in your Next.js Application using the built-in `next/image` Component.
nextjs.org
넥스트에서 이미지는 보통 레이지로딩이 된다.
즉, 화면에 보일 때야 로딩을 시작하는데 첫 로딩 시 보이는 이미지는 레이지로딩을 할 필요가 없다고 한다. (스크롤하지 않아도 첫 화면에서 바로 보이는 것들) 그런 것들은 priority 붙여주어서 해결하면 됨!
아래 주석처리된 것을 풀면 에러가 사라진다.
<Image
onClick={onClickLogo}
width={100}
height={30}
src={"/main-logo.svg"}
alt="logo"
// priority={true}
/>
'Frontend > Next.js' 카테고리의 다른 글
[Next.js][ISSUE] Textarea & input 에서 한글 입력시 마지막 글자 중복 입력됨 (+Enter key) (0) | 2024.07.18 |
---|---|
[Next.js] App Router 경로 구성하기 (next13/Parallel Routes/Intercepting Routes) (0) | 2024.06.26 |
[ISSUE][Next.js] 배포 후 이미지 오류 (엑박) (1) | 2024.06.24 |
[ISSUE][Nexts.js] 반응형 페이지 작업중 특정사이즈 이하로 반응형이 작동하지 않을 때 (0) | 2024.06.21 |
[ISSUE][Next.js] Tailwind 사용시 설정값 ui에 반영 안되는 이유 (0) | 2024.06.18 |