Title: Not working: wp_enqueue_script
Last modified: March 30, 2020

---

# Not working: wp_enqueue_script

 *  Resolved [Tom](https://wordpress.org/support/users/tderkowski/)
 * (@tderkowski)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/not-working-wp_enqueue_script/)
 * Greetings,
 * None of our scripts, which are registered via wp_enqueue_script, are getting 
   picked up by reBusted!:
 * `wp_enqueue_script( 'main', get_template_directory_uri() . '/js/main.js', array('
   jquery' ) );`
 * All stylesheets do however get picked up. Is there a known issue or are we doing
   something wrong? Have tried creating minimal examples based off WP Codex and 
   nothing seems to get reBusted! recognizing scripts.
 * Thank you!
    -  This topic was modified 6 years, 1 month ago by [Tom](https://wordpress.org/support/users/tderkowski/).

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

 *  Plugin Author [Simon Prosser](https://wordpress.org/support/users/pross/)
 * (@pross)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/not-working-wp_enqueue_script/#post-12604001)
 * Is your code in an action? Is there more of it?
 * It should work with any css/js as long as the file exists.
 *  Thread Starter [Tom](https://wordpress.org/support/users/tderkowski/)
 * (@tderkowski)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/not-working-wp_enqueue_script/#post-12604014)
 * That’s really it – it enqueues the script, the script works, but reBusted! doesn’t
   pick it up to append the cache busting query string. Originally this was a more
   complex example (jQuery dependency, placed in footer, etc.) – but no matter how
   much we strip the example down we just can’t get rebusted! to pick up any scripts.
 *  Plugin Author [Simon Prosser](https://wordpress.org/support/users/pross/)
 * (@pross)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/not-working-wp_enqueue_script/#post-12604022)
 * So.. the entirety of your script is `wp_enqueue_script( 'main', get_template_directory_uri().'/
   js/main.js', array( 'jquery' ) );`? No actions, nothing?
 * This works:
 *     ```
       add_action( 'wp_enqueue_scripts', function() {
         wp_enqueue_script( 'main-test', get_template_directory_uri() . '/js/test.js', array( 'jquery' ) );
       });
       ```
   
 * Either your code is not in `wp_enqueue_scripts` action, or maybe the handle `
   main` is used already, try and be unique, or maybe the file does not exist, why
   are you enqueing a file from the main theme folder should it be stylesheet directory?

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

The topic ‘Not working: wp_enqueue_script’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/rebusted.svg)
 * [reBusted!](https://wordpress.org/plugins/rebusted/)
 * [Support Threads](https://wordpress.org/support/plugin/rebusted/)
 * [Active Topics](https://wordpress.org/support/plugin/rebusted/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/rebusted/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/rebusted/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Simon Prosser](https://wordpress.org/support/users/pross/)
 * Last activity: [6 years, 1 month ago](https://wordpress.org/support/topic/not-working-wp_enqueue_script/#post-12604022)
 * Status: resolved