-
-
Notifications
You must be signed in to change notification settings - Fork 523
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
apollo-composable "import not found: DefaultApolloClient" #1029
Comments
Seeing this as well. As a temporary workaround, you can import the default export like so:
and then use the other exports from there:
Edit:
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 @justinwaite There are 2 changes I had to make to get queries working, the first one is the error you mentioned:
I believe this is related to #1011 |
@justinwaite If looking for a fix to
See #1011 (comment) |
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
using apollo composition I get this error |
So it needs to be |
The following vite plugin worked for me: {
name: 'fix-apollo-composable',
enforce: 'post',
transform(src, id) {
if (id.includes('@vue/apollo-composable/dist/useQuery.js')) {
return {
code: src
.replace(/onServerPrefetch,/, '')
.replace(/\:\sonServerPrefetch\(/, ': (')
.replace(/onServerPrefetch/, 'null')
.replace(/(.* require\("vue"\);)/m, ''),
id,
}
}
},
}, Edit |
How come this is taking so long to fix? The example in the docs causes this error so it's not an edge case! https://v4.apollo.vuejs.org/guide-composable/query.html#usequery |
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.)
The text was updated successfully, but these errors were encountered: