• Resolved DickRaney

    (@dickraney)


    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)
  • 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

    (@optimizingmatters)

    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

    (@dickraney)

    THANKS FRANK!!

    • This reply was modified 6 years, 3 months ago by DickRaney.
    Plugin Author Optimizing Matters

    (@optimizingmatters)

    you’re welcome Dick, feel free to leave a review of the plugin and support here! ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Breaks jQuery scripts’ is closed to new replies.