Uncaught Invariant Violation: client.watchQuery cannot be called with fetchPolicy set to "standby"
I just clone my project on Ubuntu machine and did yarn install
and then yarn
start and this giving me above error. However on my Windows machine it is working fine.
I'm using "apollo-client": "^2.6.10"
version.
Solution 1:
Try the following steps inside your project folder:
rm -rf node_modules yarn.lock
- In your
package.json
,"apollo-client": "~2.6.10"
yarn install && yarn start
In our package.json, when we use ^
(in the case here ^2.6.10
), it automatically picks a higher version and it might not be compatible with other packages.
So when this happens, make sure to use the exact version number with ~
as the prefix (in the case here ~2.6.10
).