-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DynamicServerError at build time when cache: no-store is enabled #339
Comments
Hi Mark, Generally, if you force your page to be generated statically and then make a dynamic request like this, Next.js will error, as these two modes cannot exist at the same time. I assume that's what's happening here - but with more context I can't help you. |
Hey @phryneas I have a similar issue, maube this is related. Let me give you more background. Basically, follow this blog post from Apollo to setup apollo client with next. And then if you look at server component part, you will see a similar snippet.
In the snippet comments, we are told that we can disable caching by setting
Even though that page is using default dynamic settings of Next. |
@Tagir-A I just found this issue: vercel/next.js#46737 (comment)
It seems that Next.js started using this error to detect dynamic usage. I'm not sure if we can prevent Apollo Client from actually catching these - I'll look into it. |
I tried reproducing this and I don't see it - you are using |
You can look at my reproduction here: https://github.com/phryneas/repro_next_dynamic-server-error Did you do anything differently? |
Nope, I tried to opt-out of caching on data level by using
So as a workaround, I can opt-out on route level:
This works, but usually I need to opt-out of caching on specific requests, rather than on specific routes. |
I'm honestly unsure at this point if Next.js 15 even supports that anymore - my example was really minimal and it was already failing there :/ |
That said, I think this can be fixed on the Next.js side. |
The text was updated successfully, but these errors were encountered: