Next.js Discord

Discord Forum

DynamicServerError: Dynamic server usage: Page couldn't be rendered statically because it used `head

Unanswered
American Kestrel posted this in #help-forum
Open in Discord
American KestrelOP
I get this error and I know which file is causing it, it uses edge runtime.

I tried making the fetch call from useEffect, then from a getServerSideProps function.

It works on localhost, but when deployed to production, I get the error. How can I fix this, its been over a day of trying and nothing is working.

2 Replies

put export const dynamic = 'force-static' to the page or find out why would you call header() on the static page