Open jamesfrye420 opened 2 years ago
@jamesfrye420 Did you find fix for this? I'm getting the same warning message with a very similar setup:
import { ApolloClient, InMemoryCache } from "@apollo/client";
import { NextPageContext } from "next";
import { withApollo as createWithApollo } from "next-apollo";
const createClient = (ctx?: NextPageContext) =>
new ApolloClient({
uri: process.env.NEXT_PUBLIC_API_URL as string,
connectToDevTools: true,
credentials: "include",
headers: {
cookie:
(typeof window === "undefined"
? ctx?.req?.headers.cookie
: undefined) || "",
},
cache: new InMemoryCache(),
});
export const withApollo = createWithApollo(createClient);
Warning message:
Warning: Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported.
Using:
{
"dependencies": {
...
"next": "^12.2.3",
"next-apollo": "^5.0.8"
...
}
}
For others encountering this, it looks like this might be due to using React 18. next-with-apollo users seem to also have this issue after upgrading (I just upgraded to v18 yesterday).
@jonathanmorris180 @jonathanmorris180 check this out, see if this could be useful in your case.
I get the following warning when using this as hoc inside my Next.js app
My Apollo client:
and this is how I am using it inside my pages
on rendering this my console spits out the following warning
This warning only shows up in the pages in which ssr is set to true