• Resolved joyryde

    (@joyryde)


    Hello!

    We believe that this plugin has this error due to WP Rocket but no matter what scripts we exclude from WP Rocket deferment, this error will not go away. Any thoughts on how to fix it?

    Uncaught ReferenceError: slicewp is not defined
        at HTMLDocument.<anonymous> (script-trk.js?ver=1.0.64:8:29)
        at e (jquery.min.js?ver=3.6.0:2:30038)
        at t (jquery.min.js?ver=3.6.0:2:30340)

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author iova.mihai

    (@iovamihai)

    Hey @joyryde,

    Thank you for reaching out! Did you change anything on your website? I just checked it out and the error didn’t show up in the console on my side.

    Also, can you please let me know what settings you have in WP Rocket? I tried a few combinations of JavaScript optimizations, but didn’t encounter the error.

    Thank you and best wishes,
    Mihai

    Thread Starter joyryde

    (@joyryde)

    Plugin Author iova.mihai

    (@iovamihai)

    Hey @joyryde,

    I’m not really sure what happened, but the error is now showing up for me as well on your site. However, I haven’t been able to replicate the issue on my development machine, so I’m not 100% sure what’s happening behind the scenes on your end.

    Even so, I have a hunch that this might be related to the “Delay JavaScript execution” option from WP Rocket. Because of it, a particular piece of JavaScript code isn’t loaded on the spot, so our main JavaScript file, which is dependent on this other piece of code, throws the error.

    To try to fix this, please add the following string into the “Excluded JavaScript Files” text box of the “Delay JavaScript execution” option: “var slicewp =”. Please add the string without quotes. I added the quotes here just so it’s easier to highlight what needs to be added.

    Please try it out and let me know how it goes.

    Thank you and best wishes,
    Mihai

    Thread Starter joyryde

    (@joyryde)

    Before reaching out I attempted to exclude each of the scripts that it shows in the console, but that didn’t work at all…I put these into the “Load JavaScript deferred Excluded JavaScript Files” field:

    wp-content/plugins/slicewp/assets/js/script-trk.js
    wp-includes/js/dist/
    wp-includes/js/tinymce/
    js/jquery/jquery.js
    js/jquery/jquery.min.js
    wp-includes/js/jquery/jquery.min.js
    moment.min.js
    script-trk.js

    In the “Delay javascript execution” I had this:

    /jquery-?[0-9.](.*)(.min|.slim|.slim.min)?.js
    js-(before|after)
    (?:/wp-content/|/wp-includes/)(.*)

    Per your recommendation I have now also added var slicewp = and it appears you’ve fixed the issue! I will need to play around with what I can remove fromt he above fields now, because the more scripts that I leave out, the slower the site seems to be!

    THANK YOU so much for your help!

    Plugin Author iova.mihai

    (@iovamihai)

    Hey @joyryde,

    Happy to hear it’s working nicely now! If you encounter any other issues or have any questions, please let me know.

    Thank you and best wishes,
    Mihai

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

The topic ‘Uncaught ReferenceError: slicewp is not defined’ is closed to new replies.