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.

'CountUp is not defined' when using webpack

See original GitHub issue

Hello,

Since CountUp is not defined on the window object, it appears as not defined iwhen using it with webpack. Making it window-wise fixed the issue, I can provide a PR for this.

Is it OK on your side?

Thanks, Jerome

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

8reactions
thasmocommented, Aug 25, 2017

Using the es-module syntax import CountUp from 'countup.js'; doesn’t seem to work.

0reactions
sanshuipigecommented, Oct 20, 2020

look here

<script type="text/javascript" src="./js/countup.js"></script>
<script>
    // console.log(CountUp);
        $(function(){
            var options = {
                useEasing: true,
                useGrouping: true,
                separator: ',',
                decimal: '.'
            };
            var countUp1 = new CountUp('countUp1', 0, 6, 0, 3, options);
            countUp1.start();
        });
    </script>

This code will solve your question

Read more comments on GitHub >

github_iconTop Results From Across the Web

CountUp is not defined - javascript - Stack Overflow
This code gives me Uncaught ReferenceError: CountUp is not defined in the console. PS: Don't use <script> in a render-blocking manner.
Read more >
Adding Count Up module to custom front page - Drupal Answers
When I flushed the cache, I got this error: "Uncaught ReferenceError: CountUp is not defined". What am I missing here? I'm pretty weak...
Read more >
uncaught referenceerror: $ is not defined webpack - You.com
Uncaught ReferenceError : $ is not defined. I thought by defining in the webpack.config.js the plugin section the symbol $ would be recognized:....
Read more >
Count Up.js - JavaScripting
Animates a numerical value by counting to it. ... CountUp.js is a dependency-free, lightweight Javascript class that can be used ... On npm...
Read more >
Module bundler for build process automation by Keenthemes
Run the build taks to build the theme assets default build using Webpack:. ... If you are getting this error ReferenceError: require is...
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