sweetalert2 CloseEvent error

I’ve this code in custom validate js code, but return alway this error an i can’t add a new row.Kt.swalCloseEventFinishedCallback is not a function

fmessagesadd.customValidate = function(fobj) { 
		if (passn == pass) {
			Swal.fire({
				icon: 'question',
				title: 'Attenzione',
				text: 'Invio Messaggi a '+ user.length +' Clienti?',
				showCancelButton: true,
				confirmButtonColor: '#3085d6',
				cancelButtonColor: '#d33',
				confirmButtonText: 'OK',
				cancelButtonText: 'Annulla'
			}).then((result) => {
			if (result.value == true) {
				(async () => {
					const { value: text } = await Swal.fire({
					input: 'text',
					icon: 'info',
					text: 'Inserisci la parola invio',
					confirmButtonText: 'Conferma invio messaggi',
					inputPlaceholder: 'invio',
					showCancelButton: true
					});
					if (text == "invio") {
						Swal.fire("Messaggi in invio");
						setTimeout(function(){ Swal.close();  }, 1000);
						return true;
					} else {
						Swal.fire("Invio Annulato")
						setTimeout(function(){ Swal.close();  }, 1000);
						return false;
					}})()
			} else if (result.dismiss == "cancel"){
				Swal.fire("Abort")
				return false;
				}
			})
		} else if (passn != pass){
			Swal.fire({
				title: 'Password Errata!',
				text: 'verificala in impostazioni notifiche',
				icon: 'error'
			 }).then();
			return false;
		}
     }

GT73 wrote:

> > } else if (passn != pass){

Swal.fire({
title: ‘Password Errata!’,
text: ‘verificala in impostazioni notifiche’,
icon: ‘error’
}).then(); // ← Check this

Please always refer to the sweetalert2 documentation here: https://sweetalert2.github.io/#methodsIn other words, you cannot just use .then() without param inside.This is one of the examples from the documentation, how to use .then() in sweetalert2:

Swal.fire({
  title: 'Do you want to save the changes?',
  showDenyButton: true,
  showCancelButton: true,
  confirmButtonText: `Save`,
  denyButtonText: `Don't save`,
}).then((result) => {
  /* Read more about isConfirmed, isDenied below */
  if (result.isConfirmed) {
    Swal.fire('Saved!', '', 'success')
  } else if (result.isDenied) {
    Swal.fire('Changes are not saved', '', 'info')
  }
})

I’ve rtemove it but returns always same error
https://codepen.io/appxonet/pen/WNxyLMb
debug mode
https://cdpn.io/appxonet/debug/WNxyLMb/yoMZEOgNgGnkthe part of js with errorsweetalert2.all.min.js:1 Uncaught TypeError: Kt.swalCloseEventFinishedCallback is not a function
at HTMLDivElement. (sweetalert2.all.min.js:1)

var ae = function (t, e, n, o) {// error start here row 1117
        (Kt.swalCloseEventFinishedCallback = ie.bind(null, t, n, Y(), o)),
            e.addEventListener(vt, function (t) {
                t.target === e && (Kt.swalCloseEventFinishedCallback(), delete Kt.swalCloseEventFinishedCallback);
            })}

GT73 wrote:

var ae = function (t, e, n, o) {// error start here row 1117
(Kt.swalCloseEventFinishedCallback = ie.bind(null, t, n, Y(), o)),
e.addEventListener(vt, function (t) {
t.target === e && (Kt.swalCloseEventFinishedCallback(),
delete Kt.swalCloseEventFinishedCallback);// removed ()
})}

I’ve removed () and error is no longer displayed but i cant add new rowif (text == “invio”) {
Swal.fire(“Messaggi in invio”);
setTimeout(function(){ Swal.close(); }, 1000);
return true;// it should validate but does not proceed

GT73 wrote:

I’ve removed () …

What did you remove? Please always post your updated code for discussion.

I’ve simply removed this () from here: && Kt.swalCloseEventFinishedCallback()Kt.swalCloseEventFinishedCallback is not a functionvar ae = function (t, e, n, o) {// error start here row 1117
(Kt.swalCloseEventFinishedCallback = ie.bind(null, t, n, Y(), o)),
e.addEventListener(vt, function (t) {
t.target === e && (Kt.swalCloseEventFinishedCallback(),
delete Kt.swalCloseEventFinishedCallback);// removed ()
})}the version integrated by phpmaker is 9x how can I upgrade it to 10x?Although I think the problem that it doesn’t add the line is due to the fact that the “return true” is nested right?

You should change your code instead of sweetalert2’s.

}).then(); // ← Check this

You may try remove .then().To update sweetalert2 you may replace the JavaScript under plugins\sweetalert2, but note that it may not work because the current release version of AdminLTE uses v9.10.8. Also note there are some breaking changes:
https://github.com/sweetalert2/sweetalert2/blob/master/CHANGELOG.md