Title: Breaks jQuery scripts
Last modified: August 7, 2018

---

# Breaks jQuery scripts

 *  Resolved [DickRaney](https://wordpress.org/support/users/dickraney/)
 * (@dickraney)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/breaks-jquery-scripts/)
 * If I enable javascript optimization I start getting errors like
    `Uncaught TypeError:
   jQuery(…).some-plugin-script is not a function ...`
 * I would like to optimize scripts, including these broken scripts if it can be
   done.
 * How cam I fix the problems and still get the most optimization?

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

 *  [AboutUtila](https://wordpress.org/support/users/aboututila/)
 * (@aboututila)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/breaks-jquery-scripts/#post-10569518)
 * Have you configured Autoptimize with
    Exclude scripts from Autoptimize: = jquery.
   js, jquery-migrate.min.js as a minimum?
 * When I have problems with scripts on a particular page, I use either Firefox 
   or Chrome browsers with the Web Developer extension to examine the page.
    I look
   at Web Developer -> Console to get an indication of what problems there may be
   be with scripts on the page and then add the appropriate .js files to ‘Exclude
   scripts from Autoptimize’ to see if that solves the problem.
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/breaks-jquery-scripts/#post-10572089)
 * those errors typically occur when inline JS (which by default is not optimized)
   calls on jQuery (plugin) functions that are optimized. you’ll have to either 
   exclude those jQuery (plugin) files from optimization (easiest/ safest) or tick
   the “also aggregate inline JS” but in that case you are likely to run into cache
   size issues (because inline JS often has changing values which bust the cache).
   that in turn can be fixed by excluding specific inline JS, but that can become..
   burdensome 🙂
 * hope this helps,
    frank
 *  Thread Starter [DickRaney](https://wordpress.org/support/users/dickraney/)
 * (@dickraney)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/breaks-jquery-scripts/#post-10572416)
 * THANKS FRANK!!
    -  This reply was modified 7 years, 8 months ago by [DickRaney](https://wordpress.org/support/users/dickraney/).
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/breaks-jquery-scripts/#post-10572555)
 * you’re welcome Dick, feel free to [leave a review of the plugin and support here](https://wordpress.org/support/plugin/autoptimize/reviews/#new-post)!
   🙂

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

The topic ‘Breaks jQuery scripts’ 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/)

## Tags

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

 * 4 replies
 * 3 participants
 * Last reply from: [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * Last activity: [7 years, 8 months ago](https://wordpress.org/support/topic/breaks-jquery-scripts/#post-10572555)
 * Status: resolved