Title: Uncaught SyntaxError error in Console
Last modified: June 16, 2022

---

# Uncaught SyntaxError error in Console

 *  [michaeldw](https://wordpress.org/support/users/michaeldw/)
 * (@michaeldw)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/uncaught-syntaxerror-error-in-console/)
 * Hello to the team,
    I’ve been using this plugin for a while now, thanks for that!
   I noticed a console error while visiting my pages and it seems to be linked to
   easy affiliate links. If you go on any page, you will see this in the console:
 * `Uncaught SyntaxError: Invalid regular expression flags (at autoptimize_single_697c77bb18b5f97b49460656c3b765d3.
   js:107:124)`
 * Looking at this line in particular:
 *     ```
       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()}}}}
       ```
   
 * I couldn’t find what causing the issue here,
    Thanks for your help Michael
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Funcaught-syntaxerror-error-in-console%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [Brecht](https://wordpress.org/support/users/brechtvds/)
 * (@brechtvds)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/uncaught-syntaxerror-error-in-console/#post-15743254)
 * Hi Michael,
 * I don’t immediately see anything pointing to Easy Affiliate Links, or am I missing
   something? Does the problem go away if you deactivate our plugin?
 * From what I can see it’s likely caused by Autoptimize’s JS optimization. That
   can cause all sorts of issues.
 *  [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/uncaught-syntaxerror-error-in-console/#post-15743321)
 * try adding `wp-content/plugins/easy-affiliate-links/` to the comma-separated 
   JS optimization exclusion list, that should help 🙂
 * frank (ao dev)

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

The topic ‘Uncaught SyntaxError error in Console’ is closed to new replies.

 * ![](https://ps.w.org/easy-affiliate-links/assets/icon-256x256.png?rev=2038635)
 * [Easy Affiliate Links](https://wordpress.org/plugins/easy-affiliate-links/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/easy-affiliate-links/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/easy-affiliate-links/)
 * [Active Topics](https://wordpress.org/support/plugin/easy-affiliate-links/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/easy-affiliate-links/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/easy-affiliate-links/reviews/)

 * 2 replies
 * 3 participants
 * Last reply from: [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * Last activity: [3 years, 11 months ago](https://wordpress.org/support/topic/uncaught-syntaxerror-error-in-console/#post-15743321)
 * Status: not resolved