Feathers-vuex: feathersVuex() from website example not working

Created on 6 Nov 2019  路  7Comments  路  Source: feathersjs-ecosystem/feathers-vuex

Steps to reproduce

  1. copied code from Setting up project and pasted code into Nuxt store/ directory in a store/feathers-client.js file.

  2. Configured store with code below

// src/store/store.js
import Vue from 'vue'
import Vuex from 'vuex'
import { FeathersVuex } from './feathers-client'
// Services
import BudgetFeature from './services/budgetFeature'
import BudgetField from './services/budgetField'
import CapMapFields from './services/capMapFields'
import PhaseListFeature from './services/phaseListFeature'

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

export default new Vuex.Store({
  plugins: [
    BudgetFeature,
    BudgetField,
    CapMapFields,
    PhaseListFeature
  ]
})
  1. run npm run dev and get no errors in my terminal, but I get a
    webpack-internal:///./store/feathers-client.js:22 Uncaught TypeError: feathersVuex is not a function
    in the browser with a hanging loader that doesn't resolve the page.
  • [x] Tell us what broke. The more detailed the better.
    Page does not resolve or load. Browser console says feathersVuex is not a function.

Expected behavior

Page loads with FeathersVuex configuration intact.

Actual behavior

Doesn't load page and can't use FeathersVuex

System configuration

Module versions (especially the part that's not working):
"feathers-vuex": "^2.0.5",
NodeJS version:
11.10.0
Operating System:
Windows 10
Browser Version:
Chrome Version 78.0.3904.87
Module Loader:
Nuxt/Webpack

awaiting reply

All 7 comments

There are too many possible variables for me to debug this. If you'll provide a repo that I can pull down and try, I'll see what I can do.

I think the issue is this:
import { FeathersVuex } from './feathers-client'

FeathersVuex is exported as defualt so it should be:
import FeathersVuex from './feathers-client'

Ah. That led me to see the problem. I'm not exporting FeathersVuex from the feathers-client.js file. I've updated the documentation.

Thank you!

yeah cool try to update in https://feathers-plus.github.io/ in frameworks under feathers-vuex @marshallswain

Was this page helpful?
0 / 5 - 0 ratings