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.

enter image description here


Solution 1:

Try the following steps inside your project folder:

  1. rm -rf node_modules yarn.lock
  2. In your package.json , "apollo-client": "~2.6.10"
  3. 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).