Title: Plugin conflicting with RequireJS
Last modified: August 22, 2016

---

# Plugin conflicting with RequireJS

 *  Resolved [GuerillaRadio1](https://wordpress.org/support/users/guerillaradio1/)
 * (@guerillaradio1)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/plugin-conflicting-with-requirejs/)
 * Hi there.
 * I’ve just installed the plugin and set the ‘Booking Page’ in the settings, but
   the page in question has a few console errors which seem to revolve around RequireJS(
   which I am using on this project). These errors didn’t exist on this page beforehand,
   and only exist if the plugin is configured to use a certain page.
 * I’ve taken a screenshot of the errors as they are too long-winded to copy and
   paste. Unfortunately they aren’t very descriptive so I can’t figure out where
   the problem is. Below are the links to the two screenshots:
 * [https://dl.dropboxusercontent.com/u/64842557/Screen%20Shot%202014-09-02%20at%2012.42.44.png](https://dl.dropboxusercontent.com/u/64842557/Screen%20Shot%202014-09-02%20at%2012.42.44.png)
   
   [https://dl.dropboxusercontent.com/u/64842557/Screen%20Shot%202014-09-02%20at%2012.42.56.png](https://dl.dropboxusercontent.com/u/64842557/Screen%20Shot%202014-09-02%20at%2012.42.56.png)
 * The form still displays on the page, but no JS runs because of these errors, 
   so obviously things like the datepicker don’t work.
 * Thanks in advance,
    Connor.
 * [https://wordpress.org/plugins/restaurant-reservations/](https://wordpress.org/plugins/restaurant-reservations/)

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

 *  [NateWr](https://wordpress.org/support/users/natewr/)
 * (@natewr)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/plugin-conflicting-with-requirejs/#post-5247423)
 * Hi GuerillaRadio1,
 * I’m sorry to hear that. I’ve never used RequireJS myself, but my understanding
   is that use of it on your site implies you’re loading and managing your JS dependencies.
   Is RequireJS just being used by another one of your plugins, or have you set 
   it up yourself to manage your project’s dependencies?
 *  [NateWr](https://wordpress.org/support/users/natewr/)
 * (@natewr)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/plugin-conflicting-with-requirejs/#post-5247424)
 * Sorry, I see now in your initial response you indicated that you were using RequireJS
   yourself in this project. I suspect (but don’t know) that you’ll need to register
   each of the plugin’s dependencies through RequireJS in some way.
 * You’ll find the frontend assets enqueued [here](https://github.com/NateWr/restaurant-reservations/blob/master/restaurant-reservations.php#L243).
   I suspect the source of the problem will be with [pickadate.js](http://amsul.ca/pickadate.js/).
   A quick Google search will bring up some tips on setting up pickadate with RequireJS.
 *  Thread Starter [GuerillaRadio1](https://wordpress.org/support/users/guerillaradio1/)
 * (@guerillaradio1)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/plugin-conflicting-with-requirejs/#post-5247496)
 * Thanks for the quick reply.
 * I’m still not having any luck. Where are those pickadate scripts being enqueued?
   I think I should be able to overcome this problem if I enqueue these scripts 
   before require.js, but at the minute they are being enqueued after require.js(
   see source from just before the closing <body> tag below)
 *     ```
       <script type='text/javascript' src='http://test.local/wp-includes/js/jquery/ui/jquery.ui.core.min.js'></script>
       <script type='text/javascript' src='http://test.local/wp-includes/js/jquery/ui/jquery.ui.datepicker.min.js'></script>
       <script type='text/javascript' src='http://test.local/wp-includes/js/jquery/ui/jquery.ui.widget.min.js'></script>
       <script type='text/javascript' src='http://test.local/wp-includes/js/jquery/ui/jquery.ui.accordion.min.js'></script>
       <script type='text/javascript' src='http://test.local/wp-includes/js/jquery/ui/jquery.ui.tabs.min.js'></script>
       <script type='text/javascript' src='http://test.local/wp-includes/js/jquery/ui/jquery.ui.effect.min.js'></script>
       <script type='text/javascript' src='http://test.local/wp-includes/js/jquery/ui/jquery.ui.effect-pulsate.min.js'></script>
       <script type='text/javascript' src='http://test.local/wp-includes/js/comment-reply.min.js'></script>
       <script type='text/javascript' src='http://test.local/wp-content/themes/wycliffe/library/js/libs/require.js'></script>
       <script type='text/javascript' src='http://test.local/wp-content/themes/wycliffe/library/js/main.js'></script>
       <script type='text/javascript' src='http://test.local/wp-content/plugins/restaurant-reservations/lib/simple-admin-pages/lib/pickadate/picker.js'></script>
       <script type='text/javascript' src='http://test.local/wp-content/plugins/restaurant-reservations/lib/simple-admin-pages/lib/pickadate/picker.date.js'></script>
       <script type='text/javascript' src='http://test.local/wp-content/plugins/restaurant-reservations/lib/simple-admin-pages/lib/pickadate/picker.time.js'></script>
       <script type='text/javascript' src='http://test.local/wp-content/plugins/restaurant-reservations/lib/simple-admin-pages/lib/pickadate/legacy.js'></script>
       <script type='text/javascript'>
       /* <![CDATA[ */
       var rtb_pickadate = {"date_format":"mmmm d, yyyy","time_format":"h:i A","disable_dates":[],"schedule_open":null,"schedule_closed":null,"early_bookings":null,"late_bookings":null,"date_onload":null,"time_interval":"30"};
       /* ]]> */
       </script>
       <script type='text/javascript' src='http://test.local/wp-content/plugins/restaurant-reservations/assets/js/booking-form.js'></script>
       ```
   
 *  [NateWr](https://wordpress.org/support/users/natewr/)
 * (@natewr)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/plugin-conflicting-with-requirejs/#post-5247497)
 * Hi GuerillaRadio1,
 * They’re actually enqueued when the Booking Form is loaded, in `/includes/template-
   functions.php`. Check out [rtb_enqueue_assets()](https://github.com/NateWr/restaurant-reservations/blob/master/includes/template-functions.php#L191),
   which is called early in [rtb_print_booking_form();](https://github.com/NateWr/restaurant-reservations/blob/master/includes/template-functions.php#L35).
 * You can easily disable all frontend styles and scripts by filtering [rtb-load-frontend-assets](https://github.com/NateWr/restaurant-reservations/blob/master/restaurant-reservations.php#L52).
   Then you can enqueue them at your own time and place.
 *  [NateWr](https://wordpress.org/support/users/natewr/)
 * (@natewr)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/plugin-conflicting-with-requirejs/#post-5247538)
 * This was resolved over email by enqueuing the assets in the head instead of the
   footer.

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

The topic ‘Plugin conflicting with RequireJS’ is closed to new replies.

 * ![](https://ps.w.org/restaurant-reservations/assets/icon-128x128.png?rev=2205491)
 * [Five Star Restaurant Reservations - WordPress Booking Plugin](https://wordpress.org/plugins/restaurant-reservations/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/restaurant-reservations/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/restaurant-reservations/)
 * [Active Topics](https://wordpress.org/support/plugin/restaurant-reservations/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/restaurant-reservations/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/restaurant-reservations/reviews/)

## Tags

 * [requirejs](https://wordpress.org/support/topic-tag/requirejs/)

 * 5 replies
 * 2 participants
 * Last reply from: [NateWr](https://wordpress.org/support/users/natewr/)
 * Last activity: [11 years, 9 months ago](https://wordpress.org/support/topic/plugin-conflicting-with-requirejs/#post-5247538)
 * Status: resolved