emit not being triggered within sweetalert once deployed

52 Views Asked by At

I'm using vue-sweetalert2 in my Vue project. When running it on my local machine the following works as expected, but once deployed on the live server the emit doesn't get triggered.

My code looks like this:

function tryEmit() {
  console.log('test');
  emit('test');
}

function myFunction() {
  tryEmit();

  Swal.fire(...).then((result) => {
    tryEmit();
  });
}

In the above code, the first tryEmit() works as expected both locally and live, the second one works correctly locally, but once deployed, it doesn't trigger the emit - although it does log test but nothing happens after that.

It's only when it's inside the then part that it doesn't work. I also tried it in the preConfirm and it didn't work there either. myFunction is also being called correctly (used logging to test this).

Both live and local use the same version of vue and sweetalert.

0

There are 0 best solutions below