Title: Autoptimize Datepicker error
Last modified: September 23, 2021

---

# Autoptimize Datepicker error

 *  Resolved [vchang](https://wordpress.org/support/users/vchang/)
 * (@vchang)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/autoptimize-datepicker-error/)
 * I am getting this datepicker error that causes issues with loading and selecting
   product in my woocommerce shop. When I go to autoptimize and turn off Aggregate
   JS-files it works fine. Do I have to add an exclusion to the list?
    The errors
   are: “Uncaught TypeError: document.getelementById(…) is Null” and “Uncaught TypeError:
   jquery(…).DatePicker is not a function”
 * Any help will be appreciated.

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

 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/autoptimize-datepicker-error/#post-14902814)
 * you’ll indeed have to exclude the jQuery Datapicker JavaScript files from JS 
   optimization vchang.
 * let me know if you need more help! 🙂
 * frank
 *  Thread Starter [vchang](https://wordpress.org/support/users/vchang/)
 * (@vchang)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/autoptimize-datepicker-error/#post-14903021)
 * How would I find the datepicker javascript files? Thanks.
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/autoptimize-datepicker-error/#post-14903050)
 * With “aggregate JS” off check the page’s HTML source and look for the string `
   datepicker`, you’ll very likely find one or more JS-file loaded with that as 
   part of the filename, exclude those.
 *  Thread Starter [vchang](https://wordpress.org/support/users/vchang/)
 * (@vchang)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/autoptimize-datepicker-error/#post-14903094)
 * Do I just put the name of the .js file or the do I also need to include the path
   to the file?
 *  Thread Starter [vchang](https://wordpress.org/support/users/vchang/)
 * (@vchang)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/autoptimize-datepicker-error/#post-14903127)
 * I set the file name as excluded as in “/datepicker.min.js” and this seems to 
   work but the other error is still there: “Uncaught TypeError: document.getElementById(…)
   is null
    <anonymous> [https://www.alphasciencelabs.com/wp-content/cache/autoptimize/js/autoptimize_44bd4aa4331484a2e24c3e09310b5f63.js:2216&#8221](https://www.alphasciencelabs.com/wp-content/cache/autoptimize/js/autoptimize_44bd4aa4331484a2e24c3e09310b5f63.js:2216&#8221);
 * There is no .js file associated with the error. Is this a CSS exclusion?
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/autoptimize-datepicker-error/#post-14903181)
 * No, that’s not related to CSS. Did you by any chance have “force JavaScript in
   head” active? Or “also aggregate inline JS”? If so, disable those and re-test?
 * If not you’ll have to look at the source of the JS file at line 2216 (?), but
   in that case you might have to exclude `plugins/cornerstone` (which seems one
   of the only ones that have `document.getElementById` in the source code).
 *  Thread Starter [vchang](https://wordpress.org/support/users/vchang/)
 * (@vchang)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/autoptimize-datepicker-error/#post-14903215)
 * The problem was I had “aggregate inline JS” set. I have disabled it and it work
   fine now. Thank you for the help. Much appreciated.
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/autoptimize-datepicker-error/#post-14903281)
 * you’re welcome, feel free to [leave a review of the plugin and support here](https://wordpress.org/support/plugin/autoptimize/reviews/#new-post)!
   🙂
 * have a nice day!
    frank

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

The topic ‘Autoptimize Datepicker error’ is closed to new replies.

 * ![](https://ps.w.org/autoptimize/assets/icon-256X256.png?rev=2211608)
 * [Autoptimize](https://wordpress.org/plugins/autoptimize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/autoptimize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/autoptimize/)
 * [Active Topics](https://wordpress.org/support/plugin/autoptimize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/autoptimize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/autoptimize/reviews/)

 * 8 replies
 * 2 participants
 * Last reply from: [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * Last activity: [4 years, 8 months ago](https://wordpress.org/support/topic/autoptimize-datepicker-error/#post-14903281)
 * Status: resolved