Title: Uncaught SyntaxError: Unexpected token &#8216;)&#8217;
Last modified: April 21, 2020

---

# Uncaught SyntaxError: Unexpected token ‘)’

 *  Resolved [zuoothomas](https://wordpress.org/support/users/zuoothomas/)
 * (@zuoothomas)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/uncaught-syntaxerror-unexpected-token-23/)
 * Hey Raul,
 * All of a sudden all our websites using your plugin have an the following error
   message in the cached footer js:
 * Uncaught SyntaxError: Unexpected token ‘)’
 * Clearing cache temporarily fixes it but it will return as soon as a new footer
   file is generated.
 * Any idea what is causing it?
 * Thanks in advance,
    Thomas
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Funcaught-syntaxerror-unexpected-token-23%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 15 replies - 1 through 15 (of 20 total)

1 [2](https://wordpress.org/support/topic/uncaught-syntaxerror-unexpected-token-23/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/uncaught-syntaxerror-unexpected-token-23/page/2/?output_format=md)

 *  Plugin Author [Raul P.](https://wordpress.org/support/users/alignak/)
 * (@alignak)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/uncaught-syntaxerror-unexpected-token-23/#post-12707192)
 * The error triggered on that line is due to double minification on [https://thomasvanderburg.com/wp-content/themes/Divi/includes/builder/frontend-builder/build/frontend-builder-scripts.js](https://thomasvanderburg.com/wp-content/themes/Divi/includes/builder/frontend-builder/build/frontend-builder-scripts.js)
 * Disable any minification on your theme.
    Divi must have updated something and
   the double minification is causing the error.
 * You can also disable minification of js files on FVM for testing.
    Unfortunately,
   we use PHP Minify for compressing (same as wp rocket, w3tc and others) and sometimes
   that library causes issues with minification.
 * I’ve been considering making my own library just for javascript, but no time 
   yet.
 *  Thread Starter [zuoothomas](https://wordpress.org/support/users/zuoothomas/)
 * (@zuoothomas)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/uncaught-syntaxerror-unexpected-token-23/#post-12719607)
 * Hey man,
 * Weird..I don’t see anything that could cause double minification. Divi did not
   add anything new or something.
 * Also disabling minification of js files does not fix it. Could it be something
   else?
 * Thanks for the response!
 * EDIT: Hey man, it has something to do with version 2.8.2 or 2.8.3 of FVM. I just
   updated FVM on a site that didnt had the error (running 2.8.1) and as soon as
   i updated the error started happening.
    -  This reply was modified 6 years, 1 month ago by [zuoothomas](https://wordpress.org/support/users/zuoothomas/).
 *  [ronwertz](https://wordpress.org/support/users/ronwertz/)
 * (@ronwertz)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/uncaught-syntaxerror-unexpected-token-23/#post-12719867)
 * I disabled js min on my divi site and it’s working again.
 *  Plugin Author [Raul P.](https://wordpress.org/support/users/alignak/)
 * (@alignak)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/uncaught-syntaxerror-unexpected-token-23/#post-12720044)
 * > Weird..I don’t see anything that could cause double minification. Divi did 
   > not add anything new or something.
 * The file
    `https://thomasvanderburg.com/wp-content/themes/Divi/includes/builder/
   frontend-builder/build/frontend-builder-scripts.js` is minified by default by
   Divi. FVM doesn’t know it’s already minified, because that url doesn’t end in.
   min.js so naturally, it minifies it again.
 * That’s what I mean by double minification.
 * Solution right now, is to disable JS minification on FVM until I have an update
   where that file will be automatically excluded from being minified again.
 * And you need to purge caches after that.
    -  This reply was modified 6 years, 1 month ago by [Raul P.](https://wordpress.org/support/users/alignak/).
 *  Plugin Author [Raul P.](https://wordpress.org/support/users/alignak/)
 * (@alignak)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/uncaught-syntaxerror-unexpected-token-23/#post-12723970)
 * I added frontend-builder-scripts.js to the list of exclusions so FVM will be 
   able to merge it without minification.
 * Remember to purge all caches after the update, both FVM and whatever server /
   cache plugin / cloudflare you may be using.
 *  Thread Starter [zuoothomas](https://wordpress.org/support/users/zuoothomas/)
 * (@zuoothomas)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/uncaught-syntaxerror-unexpected-token-23/#post-12749909)
 * Thanks for pushing out the new update, it sounds like that would’ve fixed it.
 * But for some reason the error just doesn’t want to go away. I cleared all possible
   cache there is, leave the status tab of FVM open on one screen (with no processed
   js files). Then i open the website on an incognito browser, and see a newly created
   footer.min.js file created. The filename (including all hash code) matches the
   file giving the error.
 * Turning off javascript minification does not get rid of the error. “Disable javascript
   processing” does get rid of the error, same with disabling the plugin.
 * Opening the log of the footer.min.js i still see /wp-content/themes/Divi/includes/
   builder/frontend-builder/build/frontend-builder-scripts.js on the list of processed
   items.
 * if I put that file on the ignore list it also fixes the error but then it obviously
   is not merged.
 * Sorry for taking so much of your time, I really don’t want to switch to an alternative
   as FVM has been the best experience so far!
 * Thanks in advance,
    Thomas
 *  Thread Starter [zuoothomas](https://wordpress.org/support/users/zuoothomas/)
 * (@zuoothomas)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/uncaught-syntaxerror-unexpected-token-23/#post-12749984)
 * The thing is, I still have a website running an old version of FVM. I’m not having
   the error on that website. So I have no idea what happened in between updates
   of FVM that is causing the error. On that old version of FVM it merges and minifies
   frontend-builder-scripts.js without any problems, while running the same version
   of Divi (and every other plugin).
 * So it must be something from one of the updates of FVM that changes the way it
   behaves around frontend-builder-scripts.js.
 * I know they are still assumptions but to me personally, that sounds logical to
   me.
 *  Plugin Author [Raul P.](https://wordpress.org/support/users/alignak/)
 * (@alignak)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/uncaught-syntaxerror-unexpected-token-23/#post-12750013)
 * The issue is certainly to do with the minification done by PHP Minify and the
   latest update was supposed to skip minification for that file.
 * If disabling minification fixes it, you have confirmation that it’s a minification
   issue, which is basically PHP Minify action on top of merging it.
 * PHP Minify was updated by FVM on version 2.7.8.
    Which older version are you 
   using that works?
 * And more importantly, does bringing that old plugin version to the new site where
   you having trouble works?
 * From what I’ve been seeing, Divi done some updates recently and even simply merging
   CSS got broken (no minification). So it’s not only about FVM version but also
   about which set of plugins and exact theme version you are using.
 * Please test that older FVM version on the site where you are having trouble and
   let me know if it works on that site.
 * You can get older versions by replacing the version number on the url:
    [https://downloads.wordpress.org/plugin/fast-velocity-minify.2.8.4.zip](https://downloads.wordpress.org/plugin/fast-velocity-minify.2.8.4.zip)
 * Versions available are here:
    [https://wordpress.org/plugins/fast-velocity-minify/#developers](https://wordpress.org/plugins/fast-velocity-minify/#developers)
 *  Thread Starter [zuoothomas](https://wordpress.org/support/users/zuoothomas/)
 * (@zuoothomas)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/uncaught-syntaxerror-unexpected-token-23/#post-12750080)
 * Hey,
 * Thanks for the quick reply.
 * > If disabling minification fixes it, you have confirmation that it’s a minification
   > issue, which is basically PHP Minify action on top of merging it.
 * Disabling minification did not fix it for me, only completely disabling merging
   or putting the file on the ignore list fixed it for me.
 * Thanks for the tip of downloading older versions. I tested a few version multiple
   times and it seems like version 2.8.3 is when the error started happening. On
   2.8.2 i do not get the error.
 *  Thread Starter [zuoothomas](https://wordpress.org/support/users/zuoothomas/)
 * (@zuoothomas)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/uncaught-syntaxerror-unexpected-token-23/#post-12750089)
 * BTW, i see on the changelog of 2.8.4:
 * > added frontend-builder-global-functions.js to the list of minification exclusions,
   > but allowing merging
 * but it is not frontend-builder-global-functions.js that is causing it but frontend-
   builder-scripts.js
 *  Plugin Author [Raul P.](https://wordpress.org/support/users/alignak/)
 * (@alignak)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/uncaught-syntaxerror-unexpected-token-23/#post-12750097)
 * > Thanks for the tip of downloading older versions. I tested a few version multiple
   > times and it seems like version 2.8.3 is when the error started happening. 
   > On 2.8.2 i do not get the error.
 * > but it is not frontend-builder-global-functions.js that is causing it but frontend-
   > builder-scripts.js
 * Thank you very much, this is helpful.
    I’ll review that update and get hopefully
   get it sorted today.
 *  Plugin Author [Raul P.](https://wordpress.org/support/users/alignak/)
 * (@alignak)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/uncaught-syntaxerror-unexpected-token-23/#post-12753194)
 * Can you please try 2.8.5 and check if it works for you?
 * I have Divi installed on a few sites but couldn’t reproduce the issue.
    It could
   be server specific, so I am not sure.
 * Also if you have some issue video related, try to add `/wp-includes/js/mediaelement/
   wp-mediaelement.min.js` to the ignore list as well.
 *  Thread Starter [zuoothomas](https://wordpress.org/support/users/zuoothomas/)
 * (@zuoothomas)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/uncaught-syntaxerror-unexpected-token-23/#post-12756962)
 * Hey Raul,
 * Sadly the new update (2.8.6) did not fix it. Again, only when putting frontend-
   builder-scripts.js on the ignore list the error goes away.
 * Strange that you can’t reproduce the error on your side. I just installed FVM
   on a fresh Divi site and again version 2.8.2 did not give any error but starting
   from 2.8.3 the error occurs.
 * This makes me think how this could be a server side issue. If you need anymore
   information, let me know!
 * Btw, I also noticed “/wp-content/themes/Divi/core/admin/js/react-dom.production.
   min.js” is not on the ignore list anymore, any reason why?
 *  Plugin Author [Raul P.](https://wordpress.org/support/users/alignak/)
 * (@alignak)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/uncaught-syntaxerror-unexpected-token-23/#post-12757308)
 * The differences between 2.8.3 and 2.8.4 are very very minimal.
    The only case
   that could impact the situation, is a new regex that I added to remove source
   maps from javascript.
 * I cannot reproduce it because your site must be using different modules or different
   versions of plugins and theme.
 * `Disabling minification did not fix it for me, only completely disabling merging
   or putting the file on the ignore list fixed it for me.`
 * In that case, the update wouldn’t do anything about it.
    I assumed that the error
   was simply the PHP Minify stripping some code from the regex function, as reported
   here: [https://github.com/matthiasmullie/minify/issues/329](https://github.com/matthiasmullie/minify/issues/329)
 * But it appears I was wrong and it’s instead something else.
    It could be that
   new regex I added as I don’t think it could be anything else.
 * I added the unicode flag on 2.8.6 assuming you could be having mixed encodings
   on that file, but that doesn’t seem to be the reason.
 * If you would like to check if it’s related to that, you can find it on the plugin
   directory, under `fast-velocity-minify/inc/functions.php` on line 329.
 * > [View post on imgur.com](https://imgur.com/2qUQc8o)
 * If you can comment that line out (prefix a # before it) and test it again, and
   if it works, let me know.
 * But the regex should be fine, so I would need to see the exact error and later
   debug the file differences, with and without that regex.
 * If not, I am sorry but you will need to use the ignore list.
    As I said, I have
   Divi on several sites, some old some new, and they are running FVM without having
   that error on that file. It may be some module you use so I don’t have that for
   testing. Those js files are unique to your site.
 * > This makes me think how this could be a server side issue.
 * It could be, because regex acts sometimes differently in different servers, OS
   or PHP versions dependng on where you are running it.
    [https://stackoverflow.com/questions/1377030/php-regex-behaves-differently-on-different-versions-or-different-oss](https://stackoverflow.com/questions/1377030/php-regex-behaves-differently-on-different-versions-or-different-oss)
 * So yes, the new regex I added could be fine on my end and not on yours.
    And 
   yes, maybe the regex is removing something on your file that shouldn’t, but then
   that would be an edge case that I need to see.
    -  This reply was modified 6 years, 1 month ago by [Raul P.](https://wordpress.org/support/users/alignak/).
 *  Thread Starter [zuoothomas](https://wordpress.org/support/users/zuoothomas/)
 * (@zuoothomas)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/uncaught-syntaxerror-unexpected-token-23/#post-12757370)
 * > The differences between 2.8.3 and 2.8.4 are very very minimal.
 * Do you mean between 2.8.2 and 2.8.3? That is where the issue started.
 * Thanks for all the other information. I’ll check it out for a second and if I
   can’t figure out anything unusual we’ll just use the ignore list.
 * Thanks for all the help!

Viewing 15 replies - 1 through 15 (of 20 total)

1 [2](https://wordpress.org/support/topic/uncaught-syntaxerror-unexpected-token-23/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/uncaught-syntaxerror-unexpected-token-23/page/2/?output_format=md)

The topic ‘Uncaught SyntaxError: Unexpected token ‘)’’ is closed to new replies.

 * ![](https://ps.w.org/fast-velocity-minify/assets/icon-128x128.jpg?rev=1440946)
 * [Fast Velocity Minify](https://wordpress.org/plugins/fast-velocity-minify/)
 * [Support Threads](https://wordpress.org/support/plugin/fast-velocity-minify/)
 * [Active Topics](https://wordpress.org/support/plugin/fast-velocity-minify/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/fast-velocity-minify/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/fast-velocity-minify/reviews/)

 * 20 replies
 * 3 participants
 * Last reply from: [Raul P.](https://wordpress.org/support/users/alignak/)
 * Last activity: [6 years, 1 month ago](https://wordpress.org/support/topic/uncaught-syntaxerror-unexpected-token-23/page/2/#post-12758638)
 * Status: resolved