vuex-easy-firestore icon indicating copy to clipboard operation
vuex-easy-firestore copied to clipboard

RangeError: Maximum call stack size exceeded

Open richard-mckenna opened this issue 4 years ago • 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!

richard-mckenna avatar Jan 13 '21 12:01 richard-mckenna

Not sure. Try undefined instead of null.

mesqueeb avatar Jan 13 '21 12:01 mesqueeb

Same error unfortunately.

richard-mckenna avatar Jan 13 '21 13:01 richard-mckenna

It only seems to be an issue with fetchAndAdd.

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

richard-mckenna avatar Jan 13 '21 14:01 richard-mckenna

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

mesqueeb avatar Jan 14 '21 01:01 mesqueeb

It seems it may be due to this Vue bug https://github.com/vuejs/vue/issues/9081

richard-mckenna avatar Jan 14 '21 12:01 richard-mckenna

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

mesqueeb avatar Jan 14 '21 12:01 mesqueeb