Title: Minify causes &#8220;Uncaught SyntaxError&#8221;
Last modified: September 4, 2022

---

# Minify causes “Uncaught SyntaxError”

 *  Resolved [ouija](https://wordpress.org/support/users/ouija/)
 * (@ouija)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/minify-causes-uncaught-syntaxerror/)
 * Hi there,
 * Just updated my client’s site with WP-Optimize 3.2.7 and cannot seem to reliably
   enable Minify anymore without it breaking JavaScript on the site and causing 
   pages to fail to load with the console error:
 * `Uncaught SyntaxError: Invalid or unexpected token -> wpo-minify-footer-b7d9f3b4.
   min.js:1228`
 * Seems to be caused by haveing `Process JavaScript files` enabled, and I have `
   Enable minification of JavaScript files` and `Enable merging of JavaScript files`
   options enabled.
 * This worked without issue prior to update. If I disable the `Enable merging of
   JavaScript files` option, the pages will load but there is an error related to
   YoastSEO in the console then: `Uncaught SyntaxError: Invalid or unexpected token(
   at [module]\n;:1:115)`
 * Enabling the `Contain each included file in its own block` option doesn’t help
   resolve the issue.
 * For now, I’ve disabled minification completely.
 * Any help is appreciated.

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

 *  Thread Starter [ouija](https://wordpress.org/support/users/ouija/)
 * (@ouija)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/minify-causes-uncaught-syntaxerror/#post-15978359)
 * **Update:** This might be an issue related to the latest version of the Yoast
   SEO plugin, as I attempted to revert WP-Optimize to v3.2.6 and getting same error
   with it now _(and I had updated Yoast SEO at the same time)_, but can’t say for
   certain because I also didn’t revert back the version of Yoast.
 *  Plugin Contributor [Venkat Raj](https://wordpress.org/support/users/webulous/)
 * (@webulous)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/minify-causes-uncaught-syntaxerror/#post-15978433)
 * [@ouija](https://wordpress.org/support/users/ouija/)
 * You could see what files are processed and merged in this file `wpo-minify-footer-
   b7d9f3b4.min.js` in Advanced tab and by clicking `show information`
 * When you see js files related to Yoast SEO, you can exclude them to single out
   which script is causing issue.
 * Since you choose to `merge` the individual scripts, if one of the script has `
   SyntaxError` then it will result in the same for minified and merged script as
   well.
 * Let me know your findings
 *  Thread Starter [ouija](https://wordpress.org/support/users/ouija/)
 * (@ouija)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/minify-causes-uncaught-syntaxerror/#post-15998085)
 * Excellent! Thank you for your instructions, really helped me figure out how to
   debug issues with JavaScript minification, and it appears that the error is being
   caused by:
    `/wp-content/plugins/wordpress-seo-premium/assets/js/dist/frontend-
   inspector-1921.min.js` which is a file related to the **YoastSEO Premium **plugin.
 * Adding this file to the _Exclude JavaScript from processing_ options seems to
   have corrected the issue.
 * Thanks again!

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

The topic ‘Minify causes “Uncaught SyntaxError”’ is closed to new replies.

 * ![](https://ps.w.org/wp-optimize/assets/icon-256x256.png?rev=1552899)
 * [WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance](https://wordpress.org/plugins/wp-optimize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-optimize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-optimize/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-optimize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-optimize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-optimize/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [ouija](https://wordpress.org/support/users/ouija/)
 * Last activity: [3 years, 8 months ago](https://wordpress.org/support/topic/minify-causes-uncaught-syntaxerror/#post-15998085)
 * Status: resolved