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.

4.0.0 update causes "Uncaught TypeError: LocomotiveScroll is not a constructor"

See original GitHub issue

Hello 👋

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 Screenshot 2020-11-17 085423

Desktop:

  • OS: Windows 10
  • Browser: Chrome 86.0.4240.198

Thank you 👊 Really appreciate the help!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
abxethcommented, Nov 17, 2020

I found the other problem. It’s now fixed in 4.0.3. Thanks.

1reaction
elliottmanghamcommented, Nov 17, 2020

It is working for me also! Thanks so much, @antoineboulanger.

Read more comments on GitHub >

github_iconTop 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 >

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