-
Notifications
You must be signed in to change notification settings - Fork 787
TypeError: Cannot read property 'getCurrentResult' of undefined #3365
Comments
@Ayc0 any chance you can put together a small runnable reproduction that shows this happening? There isn't enough to go on with the code sample you've provided. The |
@hwillson, I'm gonna push my buggy code tonight (EDT) But it was really like in the code snippet that I wrote in the example: I have a component that imports a (I think the bugs doesn't appear in the 1st render but when it gets the data and tries to re-render) |
Okay, if you run And the file that causes the issue is this one (need to be on the branch |
I tried using And upgrading to |
I think it's related to |
@Ayc0 I'm experiencing similar issues. How did you resolve this? |
@davidfant nope I didn't fix it |
Was there any progress on this? I am running into the same error with |
I'm running into the same issue, this happens during the initial render of a component which calls the lazyload query immediately after rendering. |
I think it is something to do with the render blocking. It breaks when I call the lazy query on mount within a |
if i use useLazyQuery inside other query's onComplate callback throw same error |
same error for me when trying to run useLazyQuery in a mutation through the onCompleted property: See below the log: TypeError: Cannot read property 'getCurrentResult' of undefined QueryData.handleErrorOrCompleted
View compiled QueryData.afterExecute
View compiled (anonymous function)
View compiled commitHookEffectList
View compiled commitPassiveHookEffects
View compiled HTMLUnknownElement.callCallback
View compiled invokeGuardedCallbackDev
View compiled invokeGuardedCallback
View compiled commitPassiveEffects
View compiled wrapped
View compiled flushPassiveEffects
View compiled dispatchAction
View compiled QueryData._this.runLazyQuery
View compiled onCompleted
View compiled ▼ 3 stack frames were expanded. callOncomplete MutationData.onMutationCompleted (anonymous function) |
Okay, I got this working by using the refetchQuery property instead of the onCompleted inside of my useMutation to throw off my useLazyQuery. |
I also encountered this issue as well. Here is how I fixed:
|
I have this error:
TypeError: Cannot read property 'getCurrentResult' of undefined
when doing:
with:
(I also tried
"apollo-client": "2.6.4"
)The issue seems to come from
useQuery
because I don't have the error when the return is aboveAnd I don't have multiple
apollo-client
in myyarn.lock
The text was updated successfully, but these errors were encountered: