# Issue when running application from MFE's shell : Could not find "client" in the context or passed in as an option

**URL:** <https://community.apollographql.com/t/issue-when-running-application-from-mfes-shell-could-not-find-client-in-the-context-or-passed-in-as-an-option/6761>\
**Category:** Client SDKs\
**Tags:** client\
**Created:** [September 25, 2023, 2:32pm UTC](https://community.apollographql.com/t/issue-when-running-application-from-mfes-shell-could-not-find-client-in-the-context-or-passed-in-as-an-option/6761 "2023-09-25T14:32:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dhaval\_bhatt](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/dhaval_bhatt/32/4614_2.png) [@Dhaval\_bhatt](https://community.apollographql.com/u/Dhaval_bhatt)\
**Post date:** [September 25, 2023, 2:32pm UTC](https://community.apollographql.com/t/issue-when-running-application-from-mfes-shell-could-not-find-client-in-the-context-or-passed-in-as-an-option/6761/1 "2023-09-25T14:32:23Z")

</div>

I am new to GraphQL and React.

My project is based on MFE where we have multiple MFE that will hooked to shell ultimately. I am tryying to access graphql endpoint from one of the MFE application ( Say it Product ) . If I execute my MFE project without shell ( Product ) things are working fine. I added `<ApolloProvider client={client}>` in my product MFE.

However when I am trying to hook my MFE with module-federation to shell . it’s throwing above error. appricate if any one can help me here

In Product react app

```auto
root.render(
  <StrictMode>
    <ApolloProvider client={client}>
      <App />
    </ApolloProvider>
  </StrictMode>
);

```

In Shell

1 `const ProductUI = React.lazy(() => import('product/Module'));`

2 `<ProductUI />`

---

<div class="post-metadata">

**Author:** ![lenz](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/lenz/32/4007_2.png) [@lenz](https://community.apollographql.com/u/lenz)\
**Post date:** [September 25, 2023, 2:52pm UTC](https://community.apollographql.com/t/issue-when-running-application-from-mfes-shell-could-not-find-client-in-the-context-or-passed-in-as-an-option/6761/2 "2023-09-25T14:52:42Z")

</div>

Is there a chance that your MFE is using multiple different instances of the `react` module? A `ApolloProvider` is only ever valid for one `react` version, so if these are imported from different parts of `node_module`, this might happen.

You can see this with (depending on your package manager) `yarn why react` or `npm why react`

---

<div class="post-metadata">

**Author:** ![Dhaval\_bhatt](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/dhaval_bhatt/32/4614_2.png) [@Dhaval\_bhatt](https://community.apollographql.com/u/Dhaval_bhatt)\
**Post date:** [September 26, 2023, 6:05am UTC](https://community.apollographql.com/t/issue-when-running-application-from-mfes-shell-could-not-find-client-in-the-context-or-passed-in-as-an-option/6761/3 "2023-09-26T06:05:18Z")

</div>

Thank you for your reply.

I was able to find the reason and it was silly one. sorry for it

Basically I added ApolloProvider code in Bootstrap and later I realize that when we inject MFE to shell it bypass bootstrap and load `<app>` into shell. so technically shell doesn’t have information about ApolloProvider … Have pity on me 🙁

---

<div class="post-metadata">

**Author:** ![lenz](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/lenz/32/4007_2.png) [@lenz](https://community.apollographql.com/u/lenz)\
**Post date:** [September 26, 2023, 1:08pm UTC](https://community.apollographql.com/t/issue-when-running-application-from-mfes-shell-could-not-find-client-in-the-context-or-passed-in-as-an-option/6761/4 "2023-09-26T13:08:14Z")

</div>

I’m glad you solved it!

---

<div class="post-metadata">

**Author:** ![Justin\_Gonzalez](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/justin_gonzalez/32/5359_2.png) [@Justin\_Gonzalez](https://community.apollographql.com/u/Justin_Gonzalez)\
**Post date:** [February 6, 2025, 8:48pm UTC](https://community.apollographql.com/t/issue-when-running-application-from-mfes-shell-could-not-find-client-in-the-context-or-passed-in-as-an-option/6761/5 "2025-02-06T20:48:18Z")

</div>


