From 129462d21c4578d595ccbec168b7988d461b1f29 Mon Sep 17 00:00:00 2001 From: Ryan Parker Date: Mon, 12 Sep 2022 12:15:20 -0700 Subject: [PATCH 1/2] docs(errors/large-page-data): how to see data being passed to page --- errors/large-page-data.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/errors/large-page-data.md b/errors/large-page-data.md index 9969b380299e..1ea7846c8aab 100644 --- a/errors/large-page-data.md +++ b/errors/large-page-data.md @@ -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 see the data being passed to the page open your site and run this in the devtool's console: + +```sh +document.getElementById("__NEXT_DATA__").text +``` + ### Useful Links - [Data Fetching Documentation](https://nextjs.org/docs/basic-features/data-fetching/overview) From a187cacb9d51dbd1f80a4e5d1be722e830574736 Mon Sep 17 00:00:00 2001 From: JJ Kasper Date: Mon, 12 Sep 2022 17:38:21 -0700 Subject: [PATCH 2/2] tweak --- errors/large-page-data.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/errors/large-page-data.md b/errors/large-page-data.md index 1ea7846c8aab..6a195072f43f 100644 --- a/errors/large-page-data.md +++ b/errors/large-page-data.md @@ -8,7 +8,7 @@ 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 see the data being passed to the page open your site and run this in the devtool's console: +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