반응형
Nextra .gif 파일 사용 시 "unoptimized" warning 해결
Nextra에서 .gif파일을 ![]() 형식으로 사용하면 아래와 같은 warning이 발생한다.
The requested resource "/_next/static/media/파일이름.gif" is an animated image so it will not be optimized.
Consider adding the "unoptimized" property to the <Image>.
해결방법
1. 변경 전
![.gif 파일없을 때 나오는 텍스트](/파일이름.gif)
2. 변경 후
<Image
src="/파일이름.gif"
alt=".gif 파일없을 때 나오는 텍스트"
unoptimized={true}
width={445}
height={445}
/>
1. 위와 같이 <Image> 형식으로 변경해주면 index를 사용하지 않고 페이지를 구성할 수 있다.
2. width와 height를 지정해줘야 하는 단점이 있다.
반응형
'문서 정리 프레임워크 > Nextra' 카테고리의 다른 글
[Nextra] index 없애기 (0) | 2024.08.13 |
---|---|
[Next.js, Nextra] video (0) | 2024.08.12 |
[Nextra] existSync is not a function (0) | 2024.08.11 |
[Next.js, Nextra] @next/font 패키지 경고 해결 (0) | 2024.08.09 |
[Nextra] 마크다운 파일(.md) 테이블 사용(<table></table>) (0) | 2024.04.22 |
댓글