Support » Plugin: Autoptimize » Getting 500 Internal Server Error and Uncaught exception ‘JSMinException’

  • Resolved mdailey77

    (@mdailey77)


    When I activated Autopimitize with all three minification options (HTML, CSS, Javascript) I get a 500 Internal Server error even though the site loads fine. When I turn off the Javascript option only the AO CSS returns a 500 error. The site I’m testing the plugin on is hosted on WPEngine and using the built-in site CDN.

    This is what I found in the site’s error logs with the plugin activated:
    PHP Fatal error: Uncaught exception ‘JSMinException’ with message ‘Unterminated regular expression literal.’ in /nas/content/live/extremematt/wp-content/plugins/autoptimize/classes/external/php/jsmin-1.1.1.php:123\nStack trace:\n#0 /nas/content/live/extremematt/wp-content/plugins/autoptimize/classes/external/php/jsmin-1.1.1.php(235): JSMin->action(1)\n#1 /nas/content/live/extremematt/wp-content/plugins/autoptimize/classes/external/php/jsmin-1.1.1.php(64): JSMin->min()\n#2 /nas/content/live/extremematt/wp-content/plugins/autoptimize/classlesses/autoptimizeSpeedupper.php(17): JSMin::minify(‘try{if(window.j…’)\n#3 [internal function]: ao_js_snippetcacher(‘try{if(window.j…’, ‘/nas/content/li…’)\n#4 /nas/content/live/extremematt/wp-includes/class-wp-hook.php(298): call_user_func_array(‘ao_js_snippetca…’, Array)\n#5 /nas/content/live/extremematt/wp-includes/plugin.php(203): WP_Hook->apply_filters(‘try{if(window.j…’, Array)\n#6 /nas/content/live/extremematt/wp-content/plugins/autoptimize/classes/autoptimizeScripts.php(241): apply_ in /nas/content/live/extremematt/wp-content/plugins/autoptimize/classes/external/php/jsmin-1.1.1.php on line 123

    How do I get rid of these errors?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    that’s the JS minifier (part of MrClay’s minify actually) crashing on your JS I’m afraid @mdailey77;

    Uncaught exception ‘JSMinException’ with message ‘Unterminated regular expression literal.’

    This implies there’s a problem with a JS regular expression in one specific JS-file. The only way to fix that would be to exclude your JS-files from autoptimization one by one to identify the culprit and then diving in to try find & fix the regex?

    Thank you for getting back to me. I’ll start doing some troubleshooting.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.