sweetalert2@11:5 Uncaught TypeError: Cannot call a class as a function
Taki błąd widać w konsoli. Próbujesz wywoływać alert jako funkcję, ale to jest tak naprawdę klasa. Najwyraźniej zmieniło się API i teraz trzeba używać swal.fire() zamiast swal().
Zmieniła się też konfiguracja, bo po naprawieniu niewyświetlania się cały czas pokazuje się inny błąd:
iframeConsoleRunner-6d8bf8b4b479137260842506acbb12717dace0823c023e08b96360e60b0840d9.js:1 SweetAlert2: Unexpected type of html! Expected "string" or "Element", got object
Ogólnie musiałbyś pozmieniać te wywołania, np
swal('It\'s a draw!', {
buttons: {
confirm: {
text: "OK",
value: true,
visible: true,
className: "swal-button",
},
},
}).then((value) => {
if (value) {
resetGame();
}
});
na:
swal.fire( {
text: 'It\'s a draw!',
customClass: {
confirmButton: 'swal-button',
}
}).then((value) => {
if (value) {
resetGame();
}
});
Więcej info masz w docsach.