4.0.0 update causes "Uncaught TypeError: LocomotiveScroll is not a constructor"
See original GitHub issueHello 👋
Describe the bug
Since version 4.0.0 the non-bundler instantiation has stopped working. I now get a console error:
Uncaught TypeError: LocomotiveScroll is not a constructor
To Reproduce Instantiate without a bundler as per instruction. Note I am also using jQuery.
<script src="locomotive-scroll.min.js"></script>
<script>
(function ( $ ) {
'use strict';
var scroll = new LocomotiveScroll( {
el: document.querySelector( '[data-scroll-container]' ),
smooth: true
} );
})();
</script>
Expected behavior This worked prior to version 4.0.0 update.
Screenshots
Desktop:
- OS: Windows 10
- Browser: Chrome 86.0.4240.198
Thank you 👊 Really appreciate the help!
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:8 (2 by maintainers)
Top Results From Across the Web
Cannot read properties of null when using Locomotive Scroll ...
The error occurs because no element with the data-scroll-container attribute is present on the DOM. Setting data-scroll-container in ...
Read more >Problem with new extension locomotive | WordPress.org
Hey! My fixed elements don´t work (header,footer). and in the console i have jquery.min.js?ver=3.5.1:2 Uncaught TypeError: e.indexOf is not a function at ...
Read more >Locomotive Scroll and GSAP - GreenSock
I am using the Locomotive smooth scroll script (https://locomotivemtl.github.io/locomotive-scroll/), which gives my projects a beautiful ...
Read more >[Solved]-React unable to read property of undefined-Reactjs
React Cannot read property 'bind' of undefined from constructor/componentDidMount and Unable to set state on unmounted component · React unable to read property ......
Read more >Jspdf automatic line breakdown structure examples pdf - Weebly
update react state array matrix array javascript canvas js in react ... VM1188:1 Uncaught TypeError: $ is not a function at :1:1 axios...
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 FreeTop 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
Top GitHub Comments
I found the other problem. It’s now fixed in 4.0.3. Thanks.
It is working for me also! Thanks so much, @antoineboulanger.