javascriptlaravelnpmmdbootstrap

Cannot read property 'hasAttribute' of null


I have a problem with Material Design Bootstrap, I added it with NPM but when I'm on my website, I got this error :

Uncaught TypeError: Cannot read property 'hasAttribute' of null
    at r (app.js:19116)
    at Module.o.m.n (app.js:19116)
    at o (app.js:19116)
    at app.js:19116
    at app.js:19116
    at Object../node_modules/mdb-ui-kit/js/mdb.min.js (app.js:19116)
    at __webpack_require__ (app.js:19361)
    at Object../resources/js/app.js (app.js:1845)
    at __webpack_require__ (app.js:19361)
    at app.js:19500

And there is where is the problem: hasAttribute("data-mdb-no-jquery"). I don't know how I can correct this problem.

Thank you for your answers !


Solution

  • Can you send the code block where you are using this line?

    Cannot read property 'hasAttribute' of null means that somewhere you are doing something like myVariable.hasAttribute(...) but the value of myVariable is null or undefined so there is no function to call.