mesqueeb/vuex-easy-firestore

RangeError: Maximum call stack size exceeded

richard-mckenna opened this issue · 6 comments

I'm having an issue getting vuex-easy-firestore (1.36.0) working with Vue (2.6.12) and Vuex (3.6.0). I have a simple module

const usersModule = {
  firestorePath: 'users',
  firestoreRefType: 'collection',
  moduleName: 'userData',
  statePropName: 'data',
  namespaced: true,

  state: {},
  getters: {},
  mutations: {},
  actions: {},
}

export default usersModule

If I call dispatch('userData/fetchById', user.uid, { root: true }) in a vuex action it works fine and adds the user data to the store.

If I call dispatch('userData/fetchAndAdd', null, { root: true }) in a vuex action or in mounted() on a component, I get the following error:

fetch for Firestore PATH: users [users]
Uncaught (in promise) RangeError: Maximum call stack size exceeded
    at Function.keys (<anonymous>)
    at _traverse (vue.runtime.esm.js?5593:2121)
    at _traverse (vue.runtime.esm.js?5593:2123)
    at _traverse (vue.runtime.esm.js?5593:2123)
    at _traverse (vue.runtime.esm.js?5593:2123)
    at _traverse (vue.runtime.esm.js?5593:2123)
    at _traverse (vue.runtime.esm.js?5593:2123)
    at _traverse (vue.runtime.esm.js?5593:2123)
    at _traverse (vue.runtime.esm.js?5593:2123)
    at _traverse (vue.runtime.esm.js?5593:2123)
   ...

Any thoughts on what could be causing it. It's driving me crazy!

Not sure. Try undefined instead of null.

Same error unfortunately.

It only seems to be an issue with fetchAndAdd.

fetch, fetchById and openDBChannel work everywhere. fetchAndAdd throws that error everywhere.

can you add a debugger breakpoint and find where the error is ?

It seems it may be due to this Vue bug vuejs/vue#9081

@richard-mckenna so your issue was unrelated to my library?