From 1e82e67b42bfdb32a90ccabe9237f24ef16fdc8e Mon Sep 17 00:00:00 2001 From: Michael Novotny Date: Wed, 11 Oct 2023 11:11:27 -0500 Subject: [PATCH 1/2] Updates Large Page Data error message doc to use `JSON.parse` to make reading output easier --- errors/large-page-data.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/errors/large-page-data.mdx b/errors/large-page-data.mdx index aec886bdfe16a..21973d6edc9ac 100644 --- a/errors/large-page-data.mdx +++ b/errors/large-page-data.mdx @@ -13,7 +13,7 @@ Reduce the amount of data returned from `getStaticProps`, `getServerSideProps`, To inspect the props passed to your page, you can inspect the below element's content in your browser devtools: ```bash filename="Terminal" -document.getElementById("__NEXT_DATA__").text +JSON.parse(document.getElementById("__NEXT_DATA__")?.text) ``` ## Useful Links From dcc6e49a910fbc19b52250894cf50cb79e96debd Mon Sep 17 00:00:00 2001 From: Michael Novotny Date: Wed, 11 Oct 2023 14:59:11 -0500 Subject: [PATCH 2/2] Uses `textContent` instead and removes optional Co-authored-by: Steven --- errors/large-page-data.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/errors/large-page-data.mdx b/errors/large-page-data.mdx index 21973d6edc9ac..a3c91e0758598 100644 --- a/errors/large-page-data.mdx +++ b/errors/large-page-data.mdx @@ -13,7 +13,7 @@ Reduce the amount of data returned from `getStaticProps`, `getServerSideProps`, To inspect the props passed to your page, you can inspect the below element's content in your browser devtools: ```bash filename="Terminal" -JSON.parse(document.getElementById("__NEXT_DATA__")?.text) +JSON.parse(document.getElementById("__NEXT_DATA__").textContent) ``` ## Useful Links