React Apollo Error: Invariant Violation: Could not find “client” in the context or passed in as an option

前端 未结 5 1642
一整个雨季
一整个雨季 2021-01-12 04:28

I\'m building a project using React, Apollo and Next.js. I\'m trying to update react-apollo to 3.1.3 and I\'m now getting the following error when viewing the site.

5条回答
  •  一个人的身影
    2021-01-12 05:07

    In my case, I found that I had react-apollo@3.0.1 installed as well as @apollo/react-hooks@3.0.0. Removing @apollo/react-hooks and just relying on react-apollo fixed the invariant issue for me. Make sure that you aren't using any mismatched versions in your lock file or package.json

    This is what someone said in a GitHub issue thread, which, was the case for me too. Make sure you try it!

提交回复
热议问题