• Resolved rosbiffer

    (@rosbiffer)


    Console is showing this error after turning on minify css:

    Uncaught SyntaxError: Invalid or unexpected token

    Looking at the source the error is on this line:

    <script>var bootstrap_between_768_992 = ‘<link rel=stylesheet href=mysite/wp-content/cache/minify/b3014.css media=all />

    The following line has ‘; on it, so it looks like it’s split the line. Does that cause the error?

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

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @rosbiffer

    I’m sorry about the issue you are experiencing and I am happy to assist you with this.
    Possibly thats the case. You should try to exclude the file from being minified in Performance>Minify>Css>Never minify following css files save all settings and purge the case, and see if the issue persists.
    Thanks!

    Thread Starter rosbiffer

    (@rosbiffer)

    Is it just the “minify/b3014.css” file that I should exclude? Or the original? How do I find out the original?

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @rosbiffer

    Actually, the notification is the warning regarding the preload of that CSS file.
    This means that you enabled HTTP/2 Push in Performance>Minify>CSS.
    Try disabling that option, save all settings and purge the cache and see if the warning is still there
    Thanks!

    Thread Starter rosbiffer

    (@rosbiffer)

    I’ve disabled it, cleared caches but the error is still there.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Thread Starter rosbiffer

    (@rosbiffer)

    I have the following files in that folder:

    /public_html/wp-content/cache/minify/04863.css
    /public_html/wp-content/cache/minify/0dfc8.css
    /public_html/wp-content/cache/minify/14223.css
    /public_html/wp-content/cache/minify/1c8eb.css
    /public_html/wp-content/cache/minify/5a82a.css
    /public_html/wp-content/cache/minify/5a95d.css
    /public_html/wp-content/cache/minify/5d385.css
    /public_html/wp-content/cache/minify/7b30a.css
    /public_html/wp-content/cache/minify/aae13.css
    /public_html/wp-content/cache/minify/e1515.css
    /public_html/wp-content/cache/minify/e5274.css

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @rosbiffer

    Thank you for the info.
    Can you please disable CSS minify, save all settings, and purge the cache. Delete those files manually from /wp-content/cache/minify/ folder, re-enable the feature and see if the issue persists.
    Thanks!

    Thread Starter rosbiffer

    (@rosbiffer)

    OK tried that. When I disable minify the problem disappears; the cache folder empties automatically. If I then reenable minify the same problem comes straight back.

    Thread Starter rosbiffer

    (@rosbiffer)

    I’ve just tried switching to manual mode and then under CSS Minify selecting Minify only (not combine) and it gets rid of the error. Then switching back to Combine and minify and the error is still not there. Very odd. Am I supposed to add style sheets manually under CSS file management?

    • This reply was modified 4 years ago by rosbiffer.
    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @rosbiffer

    Thank you for the information.
    It seems like one of the files does not agree with being minified.
    You should go with the manual minify and add the CSS file one by one using a help wizard (Just above General sub-box in Performance>Minify)
    Check the console after each file is added, settings saved and cache purged and see which file might be causing it.
    then you can simply remove the mentioned file from minifying by excluding it when on Auto as I mentioned before or by simply not adding into manual minify.
    Thanks!

    Thread Starter rosbiffer

    (@rosbiffer)

    With this new version in manual mode do I have to add all js and css files manually for it to work?

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @rosbiffer

    No, you can add as many as you like and as manny as can be added to avoid any issues.
    Thanks!

    Thread Starter rosbiffer

    (@rosbiffer)

    What I mean is, if I leave that blank is nothing minified?

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @rosbiffer

    Yes, that’s correct.
    Thanks!

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Uncaught SyntaxError: Invalid or unexpected token’ is closed to new replies.