Apollo-module: ApolloProvider.provide() is deprecated. Use the 'apolloProvider' option instead...

Created on 1 Sep 2018  路  5Comments  路  Source: nuxt-community/apollo-module

Version

v4.0.0-rc.1

Reproduction link

https://cmty.app/nuxt/issues/new?type=bug-report&repo=apollo-module

Steps to reproduce

Get a fresh nuxt install
Install / Config Apollo Module
Run the app

What is expected ?

To run smoothly as it was few days ago

What is actually happening?

Two error messages:
apolloProvider.prefetchAll is not a function

that is due to:

.provide() is deprecated. Use the 'apolloProvider' option instead with the provider object directly.

Additional comments?

Installed dependencies:

nuxtjs/apollo : 4.0.0-rc1
nuxtjs/axios : 5.3.1
nuxtjs/component-cache : 1.1.2
nuxtjs/pwa : 2.0.8
nuxt : 1.4.1

This could be possible after this vue-apollo commit: https://github.com/Akryum/vue-apollo/commit/62829e4a969532f8a4568302ff6f89286cde5b77

Some changes may be needed @ .nuxt/apollo-module.js

This bug report is available on Nuxt community (#c136)
bug-report

Most helpful comment

The error is gone on my end when I remove provide() method. Have a look at this :

new Vue({
  el: '#app',
  apolloProvider,
  router,
  render: h => h(App)
})

The reference is : https://akryum.github.io/vue-apollo/api/apollo-provider.html#constructor

All 5 comments

The error is gone on my end when I remove provide() method. Have a look at this :

new Vue({
  el: '#app',
  apolloProvider,
  router,
  render: h => h(App)
})

The reference is : https://akryum.github.io/vue-apollo/api/apollo-provider.html#constructor

Can you guys try this PR and see if it fixes the issue: https://github.com/nuxt-community/apollo-module/pull/158

Fixed, thanks a lot for both of you

@DuyguKeskek where is this piece of code you removed ?

@heshamelmasry77 This is old Code
new Vue({ el: '#app', // Inject apolloProvider for components to use. provide: apolloProvider.provide(), render: h => h(App) })

And this is new codigo

new Vue({ el: '#app', // Inject apolloProvider for components to use. apolloProvider, render: h => h(App) })

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gbouteiller picture gbouteiller  路  6Comments

lindesvard picture lindesvard  路  7Comments

gomezmark picture gomezmark  路  9Comments

dohomi picture dohomi  路  4Comments

Coppola-Aleandro picture Coppola-Aleandro  路  3Comments