apollo: export 'onServerPrefetch' was not found in 'vue-demi'
Describe the bug
@vue/apollo-composable
doesn’t work with vue 3 since vue-demi
cant resolve onServerPrefetch
. Seems it’s only provided by @vue/composition-api
To Reproduce Steps to reproduce the behavior:
- Create a new vue 3 project
- Install
graphql graphql-tag @apollo/client
as described here - Install and configure
@vue/apollo-composable
as described here - See warning in terminal:
warning in ./node_modules/@vue/apollo-composable/dist/useQuery.js
"export 'onServerPrefetch' was not found in 'vue-demi'
Expected behavior
One should be able to import onServerPrefetch
from @vue/apollo-composable
(or directly from vue?)
Versions vue: 3.0.2 @vue/apollo-composable: 4.0.0-apha.12 @apollo/client: 3.2.7
Additional context
Trying to import onServerPrefetch
from @vue/composition-api
leads to another warning on the terminal:
warning in ./node_modules/@vue/composition-api/dist/vue-composition-api.esm.js
"export 'default' (imported as 'Vue') was not found in 'vue'
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 109
- Comments: 35
Commits related to this issue
- fix: export onServerPrefetch was not found #1102 — committed to killix/vue-apollo by killix 3 years ago
Please stop posting comments saying you have the same issue. You can use the 👍 reaction on the initial post for that. I’m also a user that want to see this fixed but this won’t change anything except pissing off maintainers. Many people are getting notified and that’s just useless noise. Thank you 🙇🏻♂️
Any update on this?
Can you please provide an update on this issue?
Anything on this yet?
Any updates anywhere on this issue yet?
Updates please?
have the same issue
Vue 3.1.0 beta is out now with support for onServerPrefetch, see https://github.com/vuejs/vue-next/blob/master/CHANGELOG.md. If you use 3.1 beta, the issue will dissappear.
I’m using
import { provide } from "vue";
but it doesn’t help 😦like this:
import { DefaultApolloClient } from '@vue/apollo-composable'
import { apolloClient } from '@/apollo-client'
import { createApp, provide } from 'vue'
const app = createApp({
setup () {
provide(DefaultApolloClient, apolloClient)
},
render: () => h(App),
})
All you should have to do to fix this issue is to use Vue 3.1+
Same problem in here
same here :<
Same problem here.
Same issue.
I am working with this hack for now https://github.com/killix/vue-apollo/commit/1dbb4bf53a7ac68d72e67a71c14bd9beacd67839
this solved the problems for me: https://github.com/quasarframework/app-extension-apollo/issues/51#issuecomment-791977057