# Apollo vsCode extension config file with Vite React and module.export = {}

**URL:** <https://community.apollographql.com/t/apollo-vscode-extension-config-file-with-vite-react-and-module-export/6774>\
**Category:** Other Apollo Topics\
**Tags:** tooling\
**Created:** [September 27, 2023, 10:23am UTC](https://community.apollographql.com/t/apollo-vscode-extension-config-file-with-vite-react-and-module-export/6774 "2023-09-27T10:23:47Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![PuffCab](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/puffcab/32/4623_2.png) [@PuffCab](https://community.apollographql.com/u/PuffCab)\
**Post date:** [September 27, 2023, 10:23am UTC](https://community.apollographql.com/t/apollo-vscode-extension-config-file-with-vite-react-and-module-export/6774/1 "2023-09-27T10:23:47Z")

</div>

I created a React project with Vite, and I’d like to use Apollo extension to get autocompletion for my GraphQL queries.

I created a `apollo.config.js` config file at the root directory, with the indicated configuration :

```auto
module.exports = {
  client: {
    service: {
      name: "my-graphql-app",
      url: "http://localhost:4000/graphql",
    },
  },
};

```

But since my React app is of `type : module` , i get the error : `module not found ` , and from the apollo extension , i get the error `Service stats could not be loaded. This may be because you're missing an apollo.config.js file or it is misconfigured.`

I tried to just export it like this :

```auto
const client = {
  service: {
    name: "my-graphql-app",
    url: "http://localhost:4000/graphql",
  },
};
export default client;

```

And later import it in my `App.js` , and the error about the missing config file is gone, but I get no autocompletion.

If I use it with a React app bundled with CRA, works just fine.

Thanks in advance for any help or hints!

---

<div class="post-metadata">

**Author:** ![mdierker](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/mdierker/32/4628_2.png) [@mdierker](https://community.apollographql.com/u/mdierker)\
**Post date:** [September 29, 2023, 12:38pm UTC](https://community.apollographql.com/t/apollo-vscode-extension-config-file-with-vite-react-and-module-export/6774/2 "2023-09-29T12:38:46Z")

</div>

I’m hitting the same error - haven’t found a workaround yet. ☹

---

<div class="post-metadata">

**Author:** ![PuffCab](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/puffcab/32/4623_2.png) [@PuffCab](https://community.apollographql.com/u/PuffCab)\
**Post date:** [September 29, 2023, 5:33pm UTC](https://community.apollographql.com/t/apollo-vscode-extension-config-file-with-vite-react-and-module-export/6774/3 "2023-09-29T17:33:18Z")

</div>

We cannot be the only ones! 🥲

I had to go back to using CRA to create my React app, to be able to use te extension…quite sad

---

<div class="post-metadata">

**Author:** ![alessbell](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/alessbell/32/3381_2.png) [@alessbell](https://community.apollographql.com/u/alessbell)\
**Post date:** [October 16, 2023, 5:27pm UTC](https://community.apollographql.com/t/apollo-vscode-extension-config-file-with-vite-react-and-module-export/6774/4 "2023-10-16T17:27:36Z")

</div>

Hi there 👋 Just wanted folks on this thread to know that we do have a tracking issue for this: [don't work vite version 3 · Issue #79 · apollographql/vscode-graphql · GitHub](https://github.com/apollographql/vscode-graphql/issues/79)

It’s at the top of my pile, but I do have a conference coming up this week and next so I’ll get to it as soon as I can. Feel free to follow it over on GitHub, though, for updates 🙂

---

<div class="post-metadata">

**Author:** ![PuffCab](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/puffcab/32/4623_2.png) [@PuffCab](https://community.apollographql.com/u/PuffCab)\
**Post date:** [January 17, 2024, 6:25pm UTC](https://community.apollographql.com/t/apollo-vscode-extension-config-file-with-vite-react-and-module-export/6774/5 "2024-01-17T18:25:27Z")

</div>

It looks like it is solved in v1.20.0. It finally detects `apollo.config.cjs` config file 🥲

---

<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/apollo-vscode-extension-config-file-with-vite-react-and-module-export/6774/6 "2025-02-06T20:48:10Z")

</div>


