• Resolved snippet24

    (@snippet24)


    This happens only on all single page of “events”, disabling JS AO Optimization fixes the error. Noticed this errors on google search console.. The pages still load but with a 500 error when JS Optimization is On. Full debug here:

    Fatal error: Uncaught JSMin_UnterminatedStringException: JSMin: Unterminated String at byte 172: "<br /> in /home/otzerlin/public_html/wp-content/plugins/autoptimize/classes/external/php/jsmin.php:214 Stack trace: #0 /home/otzerlin/public_html/wp-content/plugins/autoptimize/classes/external/php/jsmin.php(152): JSMin->action(1) #1 /home/otzerlin/public_html/wp-content/plugins/autoptimize/classes/external/php/jsmin.php(86): JSMin->min() #2 /home/otzerlin/public_html/wp-content/plugins/autoptimize/classes/external/php/ao-minify-html.php(257): JSMin::minify('\n {"...') #3 [internal function]: AO_Minify_HTML->_removeScriptCB(Array) #4 /home/otzerlin/public_html/wp-content/plugins/autoptimize/classes/external/php/ao-minify-html.php(108): preg_replace_callback('/(\\s*)(<script\\...', Array, '<!doctype html>...') #5 /home/otzerlin/public_html/wp-content/plugins/autoptimize/classes/external/php/ao-minify-html.php(47): AO_Minify_HTML->process() #6 /home/otzerlin/public_html/wp-content/plugins/autoptimize/classes/autoptim in /home/otzerlin/public_html/wp-content/plugins/autoptimize/classes/external/php/jsmin.php on line 214

    Regards

    The page I need help with: [log in to see the link]

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

    (@optimizingmatters)

    That will also go away when you disable “minify inline CSS/ JS”, but do you have inline JS on that page that is not there on other pages?

    Thread Starter snippet24

    (@snippet24)

    Only as far as I could tell the schema ld+json in header with if (is_single()) conditional.. maybe i’m overloooking something though still searching just in case

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    hmm .. if nothing else pops up can you try not echoing that ld+json header? and if that makes the problem go away; can you try removing the line breaks in the description (my IDE had seemed to have some issue with that)?

    Thread Starter snippet24

    (@snippet24)

    and if that makes the problem go away

    mmm it didn’t :/

    • This reply was modified 3 years, 5 months ago by snippet24.
    Plugin Author Optimizing Matters

    (@optimizingmatters)

    but it does go away when “minify inline CSS/ JS” is off?

    Thread Starter snippet24

    (@snippet24)

    Yes!

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    OK, so;
    1. it’s specific to one page
    2. it goes away when JS opt is off
    3. it goes away when “minify inline JS” is off

    so the problem is with the minification of inline JS and it’s not the ld+json block.

    if you want to solve this with the smallest config change and not dig deeper; on the edit screen of said page untick “optimize JS” in the AO metabox

    if you do want to dig deeper you’ll have to start dequeuing each of the JS assets on said page to try to identify which one is causing it I’m afraid ..

    Thread Starter snippet24

    (@snippet24)

    1. it’s specific to one page

    Well I’d say one template, lots pages (there are around 500 pages) o.o

    Maybe the best minor fix option is to disable “minify inline CSS/ JS”?

    • This reply was modified 3 years, 5 months ago by snippet24.
    Plugin Author Optimizing Matters

    (@optimizingmatters)

    indeed ..

    if ever you want to dig deeper; there’s inline JS which is commented out like this;

    /*const el = document.querySelector(".custom-sticky-menu-container-fluid")
    const observer = new IntersectionObserver( 
      ([e]) => e.target.classList.toggle("is-pinned", e.intersectionRatio < 1),
      { threshold: [1] }
    );
    
    observer.observe(el);*/

    can you try either adding a space after/ before the comment identifier (so /* const .. (el); */ or simply remove said code (if only to test)?

    Thread Starter snippet24

    (@snippet24)

    Sure on it 😉

    Thread Starter snippet24

    (@snippet24)

    Removed it, problem persists, trying removing the intersection observer altogether.. update: didn’t work

    • This reply was modified 3 years, 5 months ago by snippet24.
    Plugin Author Optimizing Matters

    (@optimizingmatters)

    how frustrating .. any other inline JS you can try removing?

    Thread Starter snippet24

    (@snippet24)

    Well good news is the minify is a good workaround (with minor effects). Maybe I can create a page with noindex nofollow and for that page changing the settings so that the site is not penalized by google..

    Update: I forgot is general settings for each page with AO, then i need a staging site perhaps..

    • This reply was modified 3 years, 5 months ago by snippet24.
    • This reply was modified 3 years, 5 months ago by snippet24.
    Plugin Author Optimizing Matters

    (@optimizingmatters)

    staging would be best indeed

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    any news snippet24 ?

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

The topic ‘Possible bug: 500 error JSMin_UnterminatedStringException’ is closed to new replies.