Skip to content

How to create a full-stack NextJS 14 app with URQL's executeExchange #3585

Closed Answered by gregbrowndev
gregbrowndev asked this question in Q&A
Discussion options

You must be logged in to vote

So I found the solution!

I didn't notice the app had logged out an error message on the server because it had been lost within all the output caused by React going into an infinite render loop. However, this was the error:

web-ui:dev: ⨯ Error: Server Functions cannot be called during initial render. This would create a fetch waterfall. Try to use a Server Component to pass data to Client Components instead.
web-ui:dev: at GraphqlServerProvider (./src/contexts/graphql/provider-server.tsx:20:102)

Removing the "use server" at the top of src/lib/server.ts was enough to fix the issue.

So, I was on the right lines by making two Layout objects to initialise the URQL client. The key one is that…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by gregbrowndev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant