0

Since upgrading to WP 4.2.2, I have the following error in one of my js file :

Uncaught TypeError: jQuery(...).select2 is not a function

I google the issue and it seems that this can happen when several jquery are loaded.

However, looking in the different plugins, and in my theme, I found out that several plugins (and my theme) do wp_enqueue_script of select2.js, none of them with the same version (3.1 to 3.5.2).

So my questions :

  • is this normal that each plugins has its own version ?
  • what could be the issue for the original error : Uncaught TypeError: jQuery(...).select2 is not a function ?

Thanks for your help

1 Answer 1

1

is this normal that each plugins has its own version ?

If the script isn't registered by Core there isn't much else a plugin/theme can do but register the script itself. If would be nice if there were some standardization, but that would be a tricky problem to solve.

what could be the issue for the original error : Uncaught TypeError: jQuery(...).select2 is not a function ?

This is not likely to be directly WordPress related and I'd be guessing but see: https://stackoverflow.com/q/29968409/1735890

1
  • Thanks for the help. The search lead me to believe that there is a conflict loading those libraries, but I have not found yet the plugin that broke the loading chain. It may be the theme, but it works fine without plugin so the author will not be of much help.
    – camouyer
    Jun 9, 2015 at 20:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.