Closed khuong-tran closed 11 months ago
I tried running the example and it ran just fine for me 😅 with the versions you are mentioning
Nevermind, I just read the error log, the problem is in the generated file by graphql code gen, thank you for your quick response though, I'm closing this now. Have a great day!
It does not for me unfortunately. Importing urql calls createContext
as a side-effect but is needed to import the exchanges to create the client if I am not missing anything.
The most minimal thing I can put together to repro is this page.js
:
import {createClient} from "@urql/next";
// Required so the import is not optimized away
console.log(createClient)
export default function Home() {
return <div />
}
Versions are:
"dependencies": {
"@urql/next": "1.0.0",
"next": "13.5.3",
"react": "18.2.0",
"react-dom": "18.2.0",
"urql": "4.0.5"
}
I am down to work on a solution for this btw; I am just not sure if I am doing something wrong so if someone from the maintainer team could confirm my understanding of this issue, that would be awesome :) And if it turns out that importing anything from urql is indeed causing a side-effect breaking on RSCs, I would appreciate a nudge in the right direction for a solution; I am not super familiar with structuring of a library.
@JoviDeCroock I don't mean to be super annoying but is there a chance you could double check if I am doing something utterly wrong here?
You can import the exchanges from @urql/core
Oof, that's embarassing... I completely missed that in the example, sorry! Through my mix of client and server use I thought it was a good idea to make a joined makeClient
function and imported everything through @urql/next
instead of core in there.
Thanks a bunch and sorry for bothering!
Describe the bug
Hi, anyone encountered this bug with Server Component? I'm using next 13.4.19, all @urql/core and @urql/next version are latest
Reproduction
Just copy the example
Urql version
"urql": "^4.0.5" "@urql/core": "^4.1.1" "@urql/next": "^1.0.0"
Validations