question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: Cannot read property 'swing' of undefined

See original GitHub issue

I was getting this error while trying to use angular2-materialize on an Angular2 project of mine. Apparently, jQuery was not being loaded, despite following all the steps described here (installing and configuring angular2-materialize in projects created with angular-cli@webpack).

It turns out that, in order to get rid of the error and have the app working, I had to change the scripts in theangular-cli.json file to point to the minified version of jQuery instead of the full version as mentioned in the step-by-step installation and configuring manual.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

9reactions
rastographicscommented, Nov 15, 2016

This fixed the problem for me:

In main.ts I had:

import 'materialize-css'; import 'angular2-materialize';

After removing those two lines, everything now works!

4reactions
omidh28commented, Feb 1, 2017

Also happens when slim version of jQuery is used

Read more comments on GitHub >

github_iconTop Results From Across the Web

cannot read property swing of undefined - Stack Overflow
Uncaught TypeError: Cannot read property 'swing' of undefined. at materialize.min.js:6. (anonymous) @ materialize.min.js:6.
Read more >
TypeError: Cannot read property 'swing' of undefined ... - GitHub
I fund I don't need to import by webpack.ProvidePlugin, just list the .js in index.js (entry) solved the issue. Probably because of it...
Read more >
HTML : cannot read property swing of undefined - YouTube
HTML : cannot read property swing of undefined [ Gift : Animated Search Engine : https://bit.ly/AnimSearch ] HTML : cannot read property ......
Read more >
Javascript – cannot read property swing of undefined - iTecNote
Uncaught TypeError: Cannot read property 'swing' of undefined. at materialize.min.js:6 ... Javascript – Detecting an undefined object property.
Read more >
Uncaught TypeError: Cannot read property 'easing' of undefined
Hi Meteorites! I moved from bootstrap to materialize and I am simply unable to run the application now. Pls help to fix this!...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found