vue-sweetalert2 icon indicating copy to clipboard operation
vue-sweetalert2 copied to clipboard

Uncaught TypeError: elem.cloneNode is not a function

Open aldarund opened this issue 6 years ago • 4 comments

2vendors.app.js:43192 Uncaught TypeError: elem.cloneNode is not a function at handleJqueryElem (vendors.app.js:43192) at parseHtmlToContainer (vendors.app.js:43178) at renderTitle (vendors.app.js:43706) at renderHeader (vendors.app.js:43728) at render (vendors.app.js:43768) at MixinSwal._main (vendors.app.js:45227) at MixinSwal._main (vendors.app.js:43843) at MixinSwal.SweetAlert (vendors.app.js:45412) at new MixinSwal (vendors.app.js:43837) at Function.fire (vendors.app.js:43807)

It could crash whole vue app. Happens when the route changes but vue triggers update at that time and sweetalert triggers. and this error

aldarund avatar Oct 01 '19 10:10 aldarund

I have failed to ozprospect error. You can read more, what were you doing?

avil13 avatar Oct 01 '19 11:10 avil13

If sweetalert triggered when the page is changing this error will happen. let say we have global error handler on api that triggers sweetalert. And we have page with queries. Then we do logout and router.push to index page. And hence error. Vue will reevaluate query to api after logout and during router.push, before new page loaded. And it will trigger vue.sweetaalert and it will fail with the error above

aldarund avatar Oct 01 '19 12:10 aldarund

Hi @aldarund ,

Can you provide a code sample with codesandbox.io.

Thanks.

vincentdh avatar Oct 18 '19 13:10 vincentdh

This happened to me when I accidentally passed an Array/Object as a parameter to the message. Now I'm being careful.

swal({
  message: Array
})

vluzrmos avatar Nov 14 '20 04:11 vluzrmos