Pinia throws obj.hasOwnProperty is not a function when combined with apollo #2884
Replies: 8 comments
-
Seems to be related with #2837 |
Beta Was this translation helpful? Give feedback.
-
Can you repro without Apollo? Where is an object with null as the prototype being passed to pinia? |
Beta Was this translation helpful? Give feedback.
-
@posva this only happens with the apollo project sample. I am not sure how else I can reproduce the issue |
Beta Was this translation helpful? Give feedback.
-
I have been able to reproduce it outside of Apollo project with the following
|
Beta Was this translation helpful? Give feedback.
-
Yes, and my goal is to understand why such an object in included in pinia state by Apollo. |
Beta Was this translation helpful? Give feedback.
-
I've investigated a bit and seems that's caused by how Apollo stores data in |
Beta Was this translation helpful? Give feedback.
-
Also found this issue in the apollo-client repo apollographql/apollo-client#12199 |
Beta Was this translation helpful? Give feedback.
-
having the same issue on my end, also using "@pinia/nuxt": "0.9.0" and "pinia": "2.3.0" + "@nuxtjs/apollo": "5.0.0-alpha.14 this was not the case with "@pinia/nuxt": "0.5.5" and "pinia": "2.2.5" |
Beta Was this translation helpful? Give feedback.
-
Reproduction
https://github.com/kyurkchyan/pinia-apollo-pnpm
Steps to reproduce the bug
pnpm i
pnpm dev
obj.hasOwnProperty is not a function
Expected behavior
The app should load successfully
Actual behavior
App load fails with
obj.hasOwnProperty is not a function
errorAdditional information
If you switch to the without-pinia branch and try the same steps everything works
You don't even have to use any pinia store for this issue to happen. As soon as you install the pinia nuxt plugin everything breaks.
Further, if you downgrade the version of pinia to
0.5.5
everything starts working again. You can check that out inside the working-pinia branchI've tried all of the versions that were released after
0.5.5
none of them work.Beta Was this translation helpful? Give feedback.
All reactions