TypeError: Cannot read property 'swing' of undefined
See original GitHub issueI 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:
- Created 7 years ago
- Reactions:1
- Comments:10 (1 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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!
Also happens when slim version of jQuery is used