Skip to content

Commit

Permalink
docs(errors/large-page-data): how to see data being passed to page (#…
Browse files Browse the repository at this point in the history
…40491)

## Summary

This PR adds a note about how to see the data that this error is complaining about:

```sh
Warning: data for page "/" is xxx which exceeds the threshold of 128 kB, this amount of data can reduce performance.
```

This debug trick was something I came across in a [discussion](#39880) and I thought it would be helpful to others like it was for me.

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)


Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
  • Loading branch information
ryparker and ijjk committed Sep 13, 2022
1 parent 421029c commit 0a093c0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions errors/large-page-data.md
Expand Up @@ -8,6 +8,12 @@ One of your pages includes a large amount of page data (>= 128kB). This can nega

Reduce the amount of data returned from `getStaticProps`, `getServerSideProps`, or `getInitialProps` to only the essential data to render the page. The default threshold of 128kB can be configured in `largePageDataBytes` if absolutely necessary and the performance implications are understood.

To inspect the props passed to your page, you can inspect the below element's content in your browser devtools:

```sh
document.getElementById("__NEXT_DATA__").text
```

### Useful Links

- [Data Fetching Documentation](https://nextjs.org/docs/basic-features/data-fetching/overview)

0 comments on commit 0a093c0

Please sign in to comment.