Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cannot read property swing of undefined

I am using the CDN version of materializecss

<html>
    <head>
        <!-- css -->
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.0/css/materialize.min.css">
    </head>
    <body>
        <!-- page body -->

        <!-- scripts -->
        <script src="https://code.jquery.com/jquery-3.1.1.slim.min.js"></script>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.0/js/materialize.min.js"></script>
        <script src="scripts/scripts.js"></script>
    </body>
</html>

and getting the following error in console

Uncaught TypeError: Cannot read property 'swing' of undefined

at materialize.min.js:6

(anonymous) @ materialize.min.js:6

like image 345
Aman Kumar Avatar asked Jan 29 '17 15:01

Aman Kumar


People also ask

What does Cannot read property of undefined mean?

The “cannot read property of undefined” error occurs when you attempt to access a property or method of a variable that is undefined . You can fix it by adding an undefined check on the variable before accessing it.

Can not read property find of undefined?

The "Cannot read property 'find' of undefined" error occurs when the find() method is called on an undefined value. To solve the error, make sure to only call the find method on arrays.


1 Answers

It looks like Materialize uses extend, so you'll need the full version of jQuery - the slim version will not work.

like image 97
jdgower Avatar answered Sep 19 '22 03:09

jdgower