t4t5 / sweetalert

A beautiful replacement for JavaScript's "alert"
https://sweetalert.js.org
MIT License
22.4k stars 2.84k forks source link

Uncaught TypeError: Cannot read property 'constructor' of undefined at Se (sweetalert2:1) #889

Open afsinak opened 5 years ago

afsinak commented 5 years ago

i am getting this error on swal function call.

jonathanlundstrom commented 5 years ago

Same problem here. Suddenly stopped working.

GIP2000 commented 5 years ago

Try doing swal.fire() worked for me

afsinak commented 5 years ago

Swal.fire worked for me too.. why was that error??

On Thu, 24 Jan 2019, 13:46 GIP2000, notifications@github.com wrote:

Try doing swal.fire() worked for me

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/t4t5/sweetalert/issues/889#issuecomment-457106105, or mute the thread https://github.com/notifications/unsubscribe-auth/Asb7gRJMDSzxCdcmCaDzWvCkUyiHLSheks5vGWvBgaJpZM4aOxl4 .

Alessio9284 commented 5 years ago

https://sweetalert2.github.io/ here is the wiki

Gokalex commented 5 years ago

Same problem here, it works with .fire but now i need to go and find everywhere i've used it and update it? why was it changed?

Alessio9284 commented 5 years ago

yes @Gokalex (i don't know why)

Blair2004 commented 5 years ago

The API has been updated. "swal" is now an object which has a method "fire". https://sweetalert2.github.io/#usage

JBallin commented 5 years ago

@afsinak, as @Blair2004 explained you now need to include .fire because sweetalert2 has been updated. If you don't have any other questions, you should close the issue.

cbgrullon commented 5 years ago

I have this problem and i fix it with Swal.fire

lucasousi commented 5 years ago

if you use @toverux/ngx-sweetalert2, install sweetalert2 7.15.1 and .show() works fine.

alex-shamshurin commented 5 years ago

This was a context lost (this)

parnus01 commented 5 years ago

i try to call Swal.fire on ie11 it didn't work

Unable to get property 'constructor' of undefined or null reference

gagantous commented 5 years ago

Another way for this problem is I tried to refresh the browser using Ctrl + F5, not just default refresh page but clear all the cache and load all the css and JS again and sweetalert works just fine.

inayatazizi commented 4 years ago

You might have kept 'S' capital use small 's'. Swal(-something--) => "Wrong" swal(-something-) => "Correct"

poncianodiego commented 4 years ago

Why is this entire thread here on the sweetalert repo when this is concerning sweetalert2 which is a completely different repo o_0, mysterious is the lord's way.