Title: select2 dependency not found
Last modified: June 27, 2023

---

# select2 dependency not found

 *  Resolved [dansart](https://wordpress.org/support/users/dansart/)
 * (@dansart)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/select2-dependency-not-found/)
 * Hi there
   I get the message that select2 is missing.Newest WordPress, Woocommerce
   and Plugin Version.
 * I’ve tried to add it like so.
   This does not work, only when I set the handle (
   first parameter of the wp_enqueue_script) to “select2-js” the script gets loaded,
   but is still shown as missing.
 *     ```wp-block-code
       add_action('wp_enqueue_scripts', 
       function(){
       wp_enqueue_script('select2', 'https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/js/select2.min.js', ['jquery'], '4.0.13', TRUE);
       }
       , 1);
       ```
   
 * > [View post on imgur.com](https://imgur.com/a/RWkmgRG)
 * QueryMonitor screenshot
 * ![](https://wordpress.org/88935cff-2110-4fd8-a3a2-7b8c0c4058b2)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [ThemeHigh](https://wordpress.org/support/users/themehigh/)
 * (@themehigh)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/select2-dependency-not-found/#post-16853553)
 * Could you please check after adding the below code snippet in your child theme’s
   functions.php file to include ‘selectWoo’ in another name. 
 *     ```wp-block-code
       function th34r_enqueue_custom_scripts($hook) {
       	if(is_checkout()){
       		wp_register_script( 'selectWoo2', plugins_url() . '/woocommerce/assets/js/selectWoo/selectWoo.full.js', array( 'jquery' ), '1.0.0', false );
       		wp_enqueue_script( 'selectWoo2' );
       		wp_enqueue_style( 'select2');		
       	}
       }
       add_action('wp_enqueue_scripts', 'th34r_enqueue_custom_scripts', 10);
       add_filter('thwcfe_public_script_deps', 'th34er_public_script_deps', 99);
       function th34er_public_script_deps($deps){
       	if(is_checkout()){
       		$key = array_search('selectWoo', $deps); 
       		unset($deps[$key]);
       	}
       	return $deps;
       }
       ```
   
 * Could you please check and verify if this works for you?
 * Thank you!
 *  Thread Starter [dansart](https://wordpress.org/support/users/dansart/)
 * (@dansart)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/select2-dependency-not-found/#post-16853677)
 * Hi
   The new script gets loaded, but the error is still showing up.Do you know,
   why
 *     ```wp-block-code
       wp_register_script( 'select2', plugins_url() . '/woocommerce/assets/js/selectWoo/selectWoo.full.js', array( 'jquery' ), '1.0.0', false );
       wp_enqueue_script( 'select2' );
       ```
   
 * does not work? Only when I change the name of the handle, the script gets embedded.
 *  Plugin Author [ThemeHigh](https://wordpress.org/support/users/themehigh/)
 * (@themehigh)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/select2-dependency-not-found/#post-16859112)
 * Your issue needs a detailed check. Can you please raise a ticket through our 
   website? We hope our technical team will be able to help you.
 * Thank you!
 *  Plugin Author [ThemeHigh](https://wordpress.org/support/users/themehigh/)
 * (@themehigh)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/select2-dependency-not-found/#post-16892649)
 * Since we haven’t heard back from you, we believe that your issue is resolved.
 * We are going to mark this thread as resolved.
 * Thank you!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘select2 dependency not found’ is closed to new replies.

 * ![](https://ps.w.org/woo-checkout-field-editor-pro/assets/icon-256x256.gif?rev
   =3479964)
 * [Checkout Field Editor (Checkout Manager) for WooCommerce](https://wordpress.org/plugins/woo-checkout-field-editor-pro/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woo-checkout-field-editor-pro/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woo-checkout-field-editor-pro/)
 * [Active Topics](https://wordpress.org/support/plugin/woo-checkout-field-editor-pro/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woo-checkout-field-editor-pro/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woo-checkout-field-editor-pro/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [ThemeHigh](https://wordpress.org/support/users/themehigh/)
 * Last activity: [2 years, 11 months ago](https://wordpress.org/support/topic/select2-dependency-not-found/#post-16892649)
 * Status: resolved