When we build nextJs yarn build when it goes to the step Generating static pages we have this error:
Error occurred prerendering page "/partners/partner-with-us". Read more: https://nextjs.org/docs/messages/prerender-error
ApolloError: Dynamic server usage: Route /partners/partner-with-us couldn't be rendered statically because it used revalidate: 0 fetch http://localhost:4001 /partners/partner-with-us. See more info here: https://nextjs.org/docs/messages/dynamic-server-error
The page partner-with-us is super simple
const PartnerWithUs = () => {
return <>test</>
}
export default PartnerWithUs
We are using Apollo Graphql for fetching data on other pages. We are using: https://github.com/apollographql/apollo-client-nextjs?tab=readme-ov-file#in-client-components-and-streaming-ssr
in the main layout we have
<ApolloWrapper>
<main>{children}</main>
</ApolloWrapper>
Questions I am trying to solve to fix this issue:
- why is he trying to get to the backend for this page partners/partner-with-us ? it is just a basic html page
- is he trying to access
http://localhost:4001 /partners/partner-with-us? :4001 is the url of the backend, (frontend is :4022) - be rendered statically because it used revalidate: 0 where is this settings?
- it says ApolloError: Dynamic server usage it is an apollo (GrpahQl) error?