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.

Uncaught TypeError: $indicator.velocity is not a function

See original GitHub issue

I installed the plugins using npm and bundled it using webpack. The plugin was required as following:

export default class App extends React.Component {
   ...
  componentDidMount() {
    require('materialize-css/dist/js/materialize');
  }

  render() {
    return (
        <div className='row'>
          <div className='col s12'>
            <ul className='tabs'>
              <li className='tab col s3'><a href='#test1'>Test 1</a></li>
              <li className='tab col s3'><a className='active' href='#test2'>Test 2</a></li>
              <li className='tab col s3 disabled'><a href='#test3'>Disabled Tab</a></li>
              <li className='tab col s3'><a href='#test4'>Test 4</a></li>
            </ul>
          </div>
          <div id='test1' className='col s12'>Test 1</div>
          <div id='test2' className='col s12'>Test 2</div>
          <div id='test3' className='col s12'>Test 3</div>
          <div id='test4' className='col s12'>Test 4</div>
      </div>
    );
  }
}

I always got the Uncaught TypeError: $indicator.velocity is not a function error when clicking on Tab . However, if I required the plugin in HTML instead, it worked just fine. I’m not quite sure what’s going wrong.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:8
  • Comments:26 (5 by maintainers)

github_iconTop GitHub Comments

7reactions
Wifsimstercommented, Jul 28, 2016

Adding

window.jQuery = window.$ = require('jquery');
window.$.velocity = require('velocity-animate/velocity.js')

doesn’t fix the velocity bug anymore on v0.97.7 👎

5reactions
ArtistNeverStopcommented, Nov 1, 2016

Guys!! Just delete the JQuery dependency in materialize folder in node_modules/materialize_css/node_modules/JQuery ! 😄

this problem is because materialize have a JQuery dependency obsolete

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uncaught TypeError: $(...).velocity is not a function
If you're using Velocity with jQuery, you must require jQuery before Velocity, and you must assign jQuery globally on the window object:
Read more >
Uncaught TypeError | Is Not A Function | Solution - YouTube
Have you encountered an error like:- Uncaught TypeError - Some selector is not a function - jQuery is not a function - owlCarousel...
Read more >
Uncaught TypeError: Sine.easeInOut.getRatio is not a function
I have getting the following error in console. Uncaught TypeError: Sine.easeInOut.getRatio is not a function. Anyone can help please?
Read more >
Fixed - Uncaught TypeError: a.replace is not a function
This does assume that newCount is a string, but this might not necessarily be the case - on initial page load this is...
Read more >
Uncaught (in promise) TypeError: t[Yn] is not a function in LWC
You need to iterate over contacts.data: <template for:each={contacts.data} for:item='con'>.
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