feathersjs-ecosystem / feathers-vuex

Integration of FeathersJS, Vue, and Nuxt for the artisan developer

Home Page:https://vuex.feathersjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Quasar] boot error: TypeError: Cannot set property '$FeathersVuex' of undefined

JoseCadenas opened this issue · comments

Steps to reproduce

I am getting the error stated above, $FeathersVuex is undefined. I set up FeatherVuex pretty much verbatim up until the Vuex Store setup came along. The docs state having this:

// src/store/index.js
import Vue from 'vue'
import Vuex from 'vuex'
import { FeathersVuex } from '../feathers-client'
import auth from './store.auth'

Vue.use(Vuex)
Vue.use(FeathersVuex)

const requireModule = require.context(
  // The path where the service modules live
  './services',
  // Whether to look in subfolders
  false,
  // Only include .js files (prevents duplicate imports`)
  /\.js$/
)
const servicePlugins = requireModule
  .keys()
  .map(modulePath => requireModule(modulePath).default)

export default new Vuex.Store({
  state: {},
  mutations: {},
  actions: {},
  plugins: [...servicePlugins, auth]
})

The only modification I made was moving the Vue.use calls to Quasar Boot files:

// boot/feathers-vuex.js
//import Vuex from 'vuex'
import { FeathersVuex } from '../feathers-client'

export default ({ app }) => {
    // app.use(Vuex);
    app.use(FeathersVuex);
}

My index.js:

// src/store/index.js
import Vuex from 'vuex'
import auth from '../store/store.auth.js'

const requireModule = require.context(
    // The path where the service modules live
    './services',
    // Whether to look in subfolders
    false,
    // Only include .js files (prevents duplicate imports`)
    /\.js$/
);

const servicePlugins = requireModule
    .keys()
    .map(modulePath => requireModule(modulePath).default)

export default new Vuex.Store({
    state: {
        user: 'Jose'
    },
    mutations: {},
    actions: {},
    plugins: [...servicePlugins, auth]
});

What else should I include to further explain my issue? Any help is greatly appreciated!

###Versions
Quasar V2-Beta.12
FeathersVuex V3.16.0

commented

Quasar V2 is using Vue 3, the current version of FeathersVuex is using Vue 2.

Quasar V2 is using Vue 3, the current version of FeathersVuex is using Vue 2.

Thank you very much, I didn’t realize that! Just in case anyone is ignorant like myself, I fixed this issue with the package name @feathersjs/vuex.

Source: #555 (comment)