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
Describe the bug
I'm using @vue/apollo-composable in a Vue 3/Nuxt 3 project and I am running into a strange issue where a page of mine never loads - it just keeps loading indefinitely. After some extensive debugging into the internals of Nuxt, Vue and then Vue Apollo (which took me hours!) I found out that the issue occurs somewhere here:
Meaning - onNextResult had already ran, filled result and tried to invoke firstResolve, befure it was even defined!
A fix should be trivial and I can offer to create a PR - inside the onServerPrefetch hook check first if the result ref is already filled before returning a new Promise!
create .env file from .env.example and set API_ORIGIN to be https://speckle.xyz/graphql
yarn dev to run the app
try to open http://localhost:8081/auth-only in the browser, the page will never finish loading!
if that works try http://localhost:8081/guest-only (it depends on if ur logged in or not)
(you can login through /login, and registration occurs on https://speckle.xyz)
Sorry for the complicated setup, but these kinds of issues are often hard to replicate on basic replication repos. I'm open to fix this myself as long as someone can give me the go-ahead and will approve my changes!
Expected behavior onServerPrefetch should check if the results have already arrived instead of always returning a promise that might never resolve
Bumping this one up. This is limiting us in a different project we're working on (same stack), and, while it doesn't block us, it does make things difficult (and making us regret some of our choices 😅).
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
I'm using @vue/apollo-composable in a Vue 3/Nuxt 3 project and I am running into a strange issue where a page of mine never loads - it just keeps loading indefinitely. After some extensive debugging into the internals of Nuxt, Vue and then Vue Apollo (which took me hours!) I found out that the issue occurs somewhere here:
apollo/packages/vue-apollo-composable/src/useQuery.ts
Lines 174 to 189 in 3728928
It returns a new Promise that defines
firstResolve
andfirstReject
, but to my surprise theresult
ref was already filled!apollo/packages/vue-apollo-composable/src/useQuery.ts
Line 157 in 3728928
Meaning -
onNextResult
had already ran, filledresult
and tried to invokefirstResolve
, befure it was even defined!A fix should be trivial and I can offer to create a PR - inside the
onServerPrefetch
hook check first if theresult
ref is already filled before returning a new Promise!To Reproduce
Set up this commit: specklesystems/speckle-server@daea17d
API_ORIGIN
to behttps://speckle.xyz/graphql
yarn dev
to run the apphttp://localhost:8081/auth-only
in the browser, the page will never finish loading!http://localhost:8081/guest-only
(it depends on if ur logged in or not)(you can login through /login, and registration occurs on https://speckle.xyz)
Sorry for the complicated setup, but these kinds of issues are often hard to replicate on basic replication repos. I'm open to fix this myself as long as someone can give me the go-ahead and will approve my changes!
Expected behavior
onServerPrefetch
should check if the results have already arrived instead of always returning a promise that might never resolveVersions
vue: 3.2.44
@vue/apollo-composable: 4.0.0-beta.1
@apollo/client: 3.7.0
Additional context
The text was updated successfully, but these errors were encountered: