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
Not sure if this is the right place to report this, but we're investigating a memory issue in our next.js server and one of the cause seems to be SSR + useLazyQuery. It looks like even if the options ssr: false is passed to useLazyQuery, the QueryInfo is added to the queries set of QueryManager in the function watchQuery, but since the query is never executed on the server side, it stays in the queries variable forever.
As we use one single instance of ApolloClient, the queries variable of the QueryManager grows until OOM.
The text was updated successfully, but these errors were encountered:
Fixing this will require a lot of work on central core apis, so this will not be able to make in into the memory story of Release 3.9.
So far, our general advice is to create a new ApolloClient instance for every incoming request in SSR.
React doesn't give us any "mounted" or "unmounted" events in SSR, so it's really hard to tear down side effects like this.
Issue Description
Reported in #11242 (comment)
The text was updated successfully, but these errors were encountered: