apollo icon indicating copy to clipboard operation
apollo copied to clipboard

[Vue warn]: Injection "$apolloProvider" not found

Open tsy77 opened this issue 8 years ago • 5 comments

const httpLink = new HttpLink({ // You should use an absolute URL here uri: '/mis/server/graphql', })

// Create the apollo client const apolloClient = new ApolloClient({ link: httpLink, cache: new InMemoryCache(), connectToDevTools: true, })

Vue.use(VueApollo);

const apolloProvider = new VueApollo({ defaultClient: apolloClient, }) console.log(apolloProvider.provide()) new Vue({ el: '#app', router, provide: apolloProvider.provide(), store, filters, render: h => h(App), });

This is my usage, it looks like the document describes, but it is running with error "Injection "$apolloProvider" not found",is anyone experiencing the same problem?

tsy77 avatar Mar 06 '18 13:03 tsy77

I am, did you find a fix?

hipsterjazzbo avatar Mar 08 '18 23:03 hipsterjazzbo

Which version of vue are you guys using? As far as I know, vue 2.4.1 and 2.4.2 won't work.

jiaming-jx avatar Mar 16 '18 18:03 jiaming-jx

@LASkuma I'm on 2.5.13

hipsterjazzbo avatar Mar 20 '18 00:03 hipsterjazzbo

also having this issue, on 2.5.16

d1manson avatar Apr 17 '18 15:04 d1manson

I'm not able to reproduce this, so I need a full minimal reproduction.

Akryum avatar May 11 '18 14:05 Akryum