Describe the bug
App does not load "import not found: DefaultApolloClient"
To Reproduce
Expected behavior
No error
Versions
vue: 3.0.0-rc.5
apollo-composable: 4.0.0-alpha.10
apollo-boost: 0.4.9
Additional context
No other imports working from apollo-composable (useQuery etc.)
I think the problem is with vite. I am using a similar setup and its not working.

Seeing this as well. As a temporary workaround, you can import the default export like so:
import apollo from '@vue/apollo-composable`
and then use the other exports from there:
app.provide(apollo.DefaultApolloClient, apolloClient)
Edit:
That being said, I can't get 4.0.0-alpha.10 to work with Vue 3. I end up with an error when trying to query:
Uncaught (in promise) TypeError: Cannot read property '_apolloAppTracking' of undefined
So good luck, let me know if you get it working.
@justinwaite I tried the same thing but encountered the same error.
@pepsighan Yes, this seems to be an Issue with either vite or the packaging of the library. The imports work fine in a webpack project.
@justinwaite There are 2 changes I had to make to get queries working, the first one is the error you mentioned:
vue-demi or more likely an API change in a newer version of the composition-api. Issue is this line: const root: any = getCurrentInstance().$root. I temporarily fixed this by replacing $root with root.onServerPrefetch. Temporarily fixed by removing the whole function call (I don't use SSR)I believe this is related to #1011
@justinwaite
@pepsighan
@lzurbriggen
If looking for a fix to
Uncaught (in promise) TypeError: Cannot read property '_apolloAppTracking' of undefined
See https://github.com/vuejs/vue-apollo/issues/1011#issuecomment-674873671
Hi I am running into this issue with nuxt on 4.0.0-alpha.10. I cannot use another version because of #1081. Is there any work around?
Once I upgrade to
鈹溾攢 @nuxtjs/[email protected]
鈹斺攢 @vue/[email protected]
using apollo composition alpha-10
I get this error
v1.0.0-beta.22
BREAKING CHANGES
getCurrentInstance: The internal vm can be accessed with getCurrentInstance().proxy
So it needs to be getCurrentInstance().proxy.$root
Most helpful comment
I think the problem is with vite. I am using a similar setup and its not working.