Search code examples
javascriptvue.jsionic-frameworkpopover

Having error Uncaught RangeError: Maximum call stack size exceeded, when trying to close popover in IONIC+VUE(with vuex)


Good morning developers. I´m working in this IONIC + VUE app , specifically in some popover with some functionality, but for some reason the popover is having a weird behaviour, cause once is open and I click to close it , the first time the modal still persists and throws this error:

Uncaught RangeError: Maximum call stack size exceeded
    at Object.ownKeys 
    at hasBinary (is-binary.js:48)
    at hasBinary (is-binary.js:49)
    at hasBinary (is-binary.js:49)
    at hasBinary (is-binary.js:49)
    at hasBinary (is-binary.js:49)
    at hasBinary (is-binary.js:49)
    at hasBinary (is-binary.js:49)
    at hasBinary (is-binary.js:49)
    at hasBinary (is-binary.js:49)

then on the second click it close.

Let me give you a little of background about what i did.

Thus here the template with the button that triggers a method in vuex that does some stuffs, and also has included the method that close the modal(closeOpenedPopOver())

NOTE:If i don't put the dispatcher action to vuex , the modal close properly

TEMPLATE

    <ion-content>
      <ion-row>
        <ion-col size="6"></ion-col>
        <ion-button @click="stopModal()">
          Stop
        </ion-button>
      </ion-row>
    </ion-content>

METHOD

 methods: {
    ...mapActions(["someAction"]),

    stopModal(): void {
      this.$store.dispatch("someAction", {
        dataPopOver: 'something sent',
      });
     
      this.closeOpenedPopOver();
    },
    //method that set an action in vuex and also has the method that
    // closes the modal

    closeOpenedPopOver(): void {
      popoverController.dismiss();
    },
    //modal closer
  },

VUEX

    someAction({  dispatch }, payload) {
      commit("");
      dispatch("otherAction");
      socket.emit("something", payload);
    },
   //This first action emit something through sockets IO and also call other action in 
   charge of closing doing other stuffs


     otherAction({ state, commit }) {
      ......some other stuffs...
     },

Any Idea about why this is happening ?

Thanks in advance and Happy New 2022


Solution

  • Is weird , but downgrading the @ionic/vue version the problem disappears.