CodeSeven / toastr

Simple javascript toast notifications

Home Page:http://www.toastrjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot read property 'extend' of undefined

JohnRDOrazio opened this issue · comments

I am getting this error when trying to use toastr served from cdnjs. I am not using node, I am not importing packages. I serve jQuery on all my pages from the Google Ajax Repository CDN. So jQuery is available and loaded before toastr. However when trying to create a toast I am getting this error:

Uncaught TypeError: Cannot read properties of undefined (reading 'extend')
    at m (toastr.js:474)
    at Object.i [as success] (toastr.js:474)
    at Object.success (extending.js:712)
    at c (jquery.min.js:2)
    at Object.fireWith [as resolveWith] (jquery.min.js:2)
    at l (jquery.min.js:2)
    at XMLHttpRequest.<anonymous> (jquery.min.js:2)
m @ toastr.js:474
i @ toastr.js:474
success @ extending.js:712
c @ jquery.min.js:2
fireWith @ jquery.min.js:2
l @ jquery.min.js:2
(anonymous) @ jquery.min.js:2

Sorry my bad, I noticed that there was a glitch in my setup where toastr was actually getting loaded before jQuery. Once I fixed that it worked perfectly.