Title: Uncaught SyntaxError: Invalid regular expression flags
Last modified: February 8, 2019

---

# Uncaught SyntaxError: Invalid regular expression flags

 *  [rperrett](https://wordpress.org/support/users/rperrett/)
 * (@rperrett)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/uncaught-syntaxerror-invalid-regular-expression-flags-3/)
 * Hi,
 * Great plugin, awesome work!
 * After installing and configuring yesterday for a client, all was running well
   and my client was very happy with 95 google page score.
 * However today, JS is broken on the site (no changes since yesterday). I’m seeing
   2 errors in the JS console:
 * – Uncaught SyntaxError: Invalid regular expression flags
    `try{/s/loaded/6e0d87d95b19.
   js}catch(e){console.log(e)}try{window._wpemojiSettings ={"baseUrl":"https:\/\/
   s.w.org\/images\/core\/emoji\/2.2.1\/72x72\/","ext":".png","svgUrl":"https:\/\/
   s.w.org\/images\/core\/emoji\/2.2.1\/svg\/","svgExt":".svg"}}catch(e){console.
   log(e)}try{// Source: wp-includes/js/twemoji.min.js`
 * – ReferenceError: jQuery is not defined
 * After browsing through support here, I discovered that the option “load external
   scripts” is causing the error. Disabling this option corrects the issue.
 * Suggestion: Can this option “load external scripts be moved to under the JS menu”?
   It would have been much easier to find and troubleshoot if it was under the JS
   menu. I wasn’t looking for a JS merge option under “browser caching”.
 * Question: How often does your plugin update its JS cache? What is the need to
   do this? Call me overly cautious, but I would rather this be a manual process.
 * Main question: Can you fix this error so I can re-enable the option again?
 * Thanks!
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Funcaught-syntaxerror-invalid-regular-expression-flags-3%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

The topic ‘Uncaught SyntaxError: Invalid regular expression flags’ is closed to 
new replies.

 * ![](https://ps.w.org/psn-pagespeed-ninja/assets/icon.svg?rev=1722219)
 * [PageSpeed Ninja - Cache, Minify, Defer CSS JavaScript, Critical CSS, Optimize Images, Convert WebP](https://wordpress.org/plugins/psn-pagespeed-ninja/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/psn-pagespeed-ninja/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/psn-pagespeed-ninja/)
 * [Active Topics](https://wordpress.org/support/plugin/psn-pagespeed-ninja/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/psn-pagespeed-ninja/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/psn-pagespeed-ninja/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [rperrett](https://wordpress.org/support/users/rperrett/)
 * Last activity: [7 years, 3 months ago](https://wordpress.org/support/topic/uncaught-syntaxerror-invalid-regular-expression-flags-3/)
 * Status: not resolved