You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered the "Dynamic server usage" error when fetchOptions.cache was set to no-store and the query function was used in an RSC component. According to the error message, it seems that Next failed to detect that the RSC component depends on API requests during prerendering.
Error occurred prerendering page "/". Read more: https://nextjs.org/docs/messages/prerender-error
ApolloError: Dynamic server usage: Route / couldn't be rendered statically because it used revalidate: 0 fetch https://swapi-graphql.netlify.app/.netlify/functions/index /.
See more info here: https://nextjs.org/docs/messages/dynamic-server-error
As a workaround, I could successfully build by defining export const dynamic = 'force-dynamic'; in the Page component. However, Ideally, I would like to build without any workaround as it would be a more intuitive.
I encountered the "Dynamic server usage" error when
fetchOptions.cache
was set tono-store
and thequery
function was used in an RSC component. According to the error message, it seems that Next failed to detect that the RSC component depends on API requests during prerendering.As a workaround, I could successfully build by defining
export const dynamic = 'force-dynamic';
in the Page component. However, Ideally, I would like to build without any workaround as it would be a more intuitive.The errors occurred in both Next.js 14 and 15.
Reproduction
https://github.com/ktmouk/apollo-next-no-store
The text was updated successfully, but these errors were encountered: