mesqueeb / vuex-easy-firestore

Easy coupling of firestore and a vuex module. 2-way sync with 0 boilerplate!
https://mesqueeb.github.io/vuex-easy-firestore
MIT License
234 stars 28 forks source link

RangeError: Maximum call stack size exceeded #366

Open richard-mckenna opened 3 years ago

richard-mckenna commented 3 years ago

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!

mesqueeb commented 3 years ago

Not sure. Try undefined instead of null.

richard-mckenna commented 3 years ago

Same error unfortunately.

richard-mckenna commented 3 years ago

It only seems to be an issue with fetchAndAdd.

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

mesqueeb commented 3 years ago

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

richard-mckenna commented 3 years ago

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

mesqueeb commented 3 years ago

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