• Resolved ouija

    (@ouija)


    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

    (@ouija)

    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

    (@webulous)

    @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

    (@ouija)

    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.