• Resolved swissspaceboy

    (@swissspaceboy)


    Goeiemorgen Frank,

    Since I upgraded to WP5.3.3 from 4.9.8, I have this JS console error with JS script “color-picker.min.js”. This seems to be called from the plugin “Directorist” (I could only find his code that calls this script)

    When I disable the JS optimisation completely, the error is gone. The “Aggregate JS-files” is having a problem with this plugin “Directorist” and with this WordPress admin script.

    I have excluded the script “color-picker.min.js”, otherwise my website freezes. I still get the error in my console.

    WP: 5.5.3
    Error:

    Uncaught ReferenceError: wp is not defined
    at color-picker.min.js:2
    at color-picker.min.js:2
    (anonymous) @ color-picker.min.js:2
    (anonymous) @ color-picker.min.js:2

    Any idea?

    Hartelijke dank!

    Didier.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    Try excluding wp-includes/js (which has a.o. the JS that sets the wp object)?

    Thread Starter swissspaceboy

    (@swissspaceboy)

    Bingo !

    Excluding “wp-includes/js” did the trick. No need to exclude the color-picker script anymore.

    Do you have an explanation why this JS script gives a problem? Is this some load order optimisation problem?

    Many thanks for your VERY FAST help (< 1 minute) 🙂

    Didier.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    looks like that color JS depends on the wp-object & some inline JS (now, probably not < 5.x) and AO when excluding does not look at wp_enqueue_script dependancies so you indeed have to explicitly tell AO to exclude the wp-includes JS (you can probably be more specific, but I’ll leave that as an exercise for you 😉 ).

    frank

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Error with JS script “color-picker.min.js”’ is closed to new replies.