Notion api 로 불러오면서 하위 이미지와 같은 경고 문이 뜬다.

Warning: data for page "/" is 184 kB which exceeds the threshold of 128 kB, this amount of data can reduce performance.
See more info here: https://nextjs.org/docs/messages/large-page-data

 

Large Page Data

공식 문서(https://nextjs.org/docs/messages/large-page-data) 에서는 데이터 양을 줄이라는 해결책을 줬지만 내 경우에 해당하는 해결 방법이 아니어서 다른 방법을 찾아보았다.

 

next.config.js

나랑 똑같은 문제를 겪고 있는 글을 찾아보니 next.config.js 에서 largePageDataBytes 의 값을 늘리는 방법이 있다.

const nextConfig = {
  ...
  experimental: {
  //largePageDataBytes: 128 * 1000, // 128KB by default
    largePageDataBytes: 128 * 100000,
  },
  ...
}

 

하지만 해당 설정을 할 경우 아래 경고 문이 나온다.

largePageDataBytes는 실험적인 기능으로 예상치 못한 또는 오동작을 일으킬 수 있다는 것을 알려주는 경고문으로 해당 기능 사용을 보류했다.

- warn You have enabled experimental feature (largePageDataBytes) in next.config.js.
- warn Experimental features are not covered by semver, and may cause unexpected or broken application behavior. Use at your own risk.

 

 

참고

 

Warning: data for page "/blog/....") is 569 kB which exceeds the threshold of 128 kB, this amount of data can reduce performance

What is the best way to handle "Warning: data for page "/blog/....") is 569 kB which exceeds the threshold of 128 kB, this amount of data can reduce performance" in nextjs for mdx

stackoverflow.com

 

 

[nextjs] next.config.js 기초 정리

nextjs에서 환경설정을 하고, custom한 설정(configuration of Next.js)을 하기위해서 next.config.js를 사용하면 된다. next.config.js에 대한 기초적인 지식부터 심화 부분까지 정리해 보자. 우선은 실무단계에서

han-py.tistory.com

 

 

 

'에러 일지' 카테고리의 다른 글

Notion api 100개 초과일 때  (0) 2024.09.06
CORS 에러  (0) 2024.08.30
ReferenceError: window is not defined  (0) 2024.08.25
Hydration failed 에러  (0) 2024.08.22
minsun309