• Resolved wpnh

    (@wpnh)


    Hello,

    we are having a lot of sites, and at every website i´ve updated your plugin to the lastest version, i´m getting this error in the console:

    Uncaught SyntaxError: invalid regular expression flag f

    Can you help me out here? This comes only after activating Merge JS files…

    Bye, Nico

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

    (@optimizingmatters)

    OK, let’s start with some questions Nico:
    * where do you see the error, in the PHP errorlog or on the browser console?
    * what file & line number is identified together with the error?
    * from what version were you upgrading to 2.9.5.1?

    frank

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    any news Nico?

    Thread Starter wpnh

    (@wpnh)

    Hi Frank,
    i´m seeing this in the browser console.
    Uncaught SyntaxError: invalid regular expression flag f

    js/autoptimize_single_xxxxxxxx.js

    after clicking the error message, this part i marked:

    if(this.method===’GET’||this.method===’HEAD’){if(options.cache===’no-store’||options.cache===’no-cache’){var reParamSearch=/([?&])_=[^&]*/if(reParamSearch.test(this.url)){this.url=this.url.replace(reParamSearch,’$1_=’+new Date().getTime())}else{var reQueryString=/\?/this.url+=(reQueryString.test(this.url)?’&’:’?’)+’_=’+new Date().getTime()}}}}

    —————
    LINE 107

    Plugin Version from 2.7.8 (i guess) to Version 2.9.5.1

    Thanks

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    OK, that JS is not Autoptimize’s, it’s merely being optimized by AO and based on the code snippet it *looks* like it’s WordPress core’s (blocks) wp-includes/js/dist/wp-polyfill-fetch.js which is loaded instead of wp-includes/js/dist/wp-polyfill-fetch.min.js because you’re likely having script debugging on. the best solution would be to disable script debugging, in which case AO will not mess with wp-polyfill-fetch as it will be minified already. alternatively you can untick the “minify excluded CSS/ JS” option.

    hope this helps,
    frank

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    any news wpnh ?

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    No feedback so I assume this got resolved? Feel free to follow up if you still encounter issues!

    have a nice day!
    frank

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

The topic ‘Uncaught SyntaxError: invalid regular expression flag f’ is closed to new replies.