this erorr log =(Error fetching current user: n [Error]: Dynamic server usage: Route /about/policy couldn’t be rendered statically because it used headers
. See more info here: DynamicServerError - Dynamic Server Usage | Next.js
at l (/opt/build/repo/.next/server/chunks/948.js:1:37247)
1:56:59 PM: at d (/opt/build/repo/.next/server/chunks/774.js:60:4346)
1:56:59 PM: at s (/opt/build/repo/.next/server/chunks/774.js:59:20300)
1:56:59 PM: at h (/opt/build/repo/.next/server/chunks/117.js:9:6124)
1:56:59 PM: at m (/opt/build/repo/.next/server/chunks/117.js:9:6163)
1:56:59 PM: at S (/opt/build/repo/.next/server/chunks/117.js:9:7597)
1:56:59 PM: at eh (/opt/build/repo/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:134786)
1:56:59 PM: at e (/opt/build/repo/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:137671)
1:56:59 PM: at ek (/opt/build/repo/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:138145)
1:56:59 PM: at Array.toJSON (/opt/build/repo/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:135755) {
1:56:59 PM: description: “Route /about/policy couldn’t be rendered statically because it used headers
. See more info here: DynamicServerError - Dynamic Server Usage | Next.js”,
1:56:59 PM: digest: ‘DYNAMIC_SERVER_USAGE’
1:56:59 PM: })
@EngAmen Did you read the Next documentation that it links to?
https://nextjs.org/docs/messages/dynamic-server-error
Yes, but I don’t understand exactly where my mistake is in the code
@EngAmen Netlify’s staff operate to their Scope of Support, an important part of which is:
Support limits
- Base functionality of Netlify’s build and deploy pipeline is supported, but we cannot help you debug any source code used either during build or after deployment. We’ll be willing to help troubleshoot any build failure that you can confirm in our build image when well-configured, and we’ll guide you in debugging the behavior of your site at a very high level.
I don’t work for Netlify, and I can’t help you because I don’t work with Next.js (and have no interest in doing so), and unfortunately there’s otherwise not a very active community here.
Someone might come along, but I wouldn’t hold my breath.
So you might want to reach out to the Next.js community: