Rocket Loader breaking external scroll and scrollwheel javascripts


#1

Just an FYI, when we load individual javascripts that increase use of scroll wheels, or finger swiping, or even “smooth scrolling” I’ve noticed that Rocket Launcher breaks the script.

In Google Chrome, you cannot scroll through websites or even use the scroll bar on the side.

This seems to be only Google Chrome and firefox, edge, IE, brave, all remain unaffected.

Disabled “Rocket Loader” in our dashboard solves the problem. Found this while working on https://cyberfmradio.com


#2

Rocket Loader is considered Beta because it’s an experimental feature that modifies the loading and execution flow of Javascript. While efforts are taken to increase Rocket Loader’s compatibility with third-party Javascripts, not all scripts work with this feature. Issues with Rocket Loader affect only a small percentage of customers.

You can exclude certain scripts from being Rocket Loaded. Then you can find the culprit and omit it.

You can have Rocket Loader ignore individual scripts by adding the data-cfasync=“false” attribute to the relevant script tag, for example:

  <script data-cfasync="false" src="/javascript.js"></script>      

Rocket Loader will still work for all other scripts.

Also keep in mind RL doesn’t work on external scripts. So using it may completely f-up the loading order of scripts.

Personally I don’t use RL at all… too many issues to be worth the trouble. Instead, use cdnjs to load your javascript libraries.


#3

I like the idea of being able to exclude individual scripts. I wasn’t aware of that… but right now, I’m satisfied just keeping it disabled I think.

I’ll check out cdnjs, thanks so much!


#4

@james.tylee I’ve tested the https://cyberfmradio.com with Rocket Loader enabled (internally for testing) in desktop Google Chrome and I can scroll without issue, and there are no JS errors.

Could you let me know more about the exact problem and how to replicate it?

As a note on using data-cfasync="false" you do need to be careful about which scripts you omit - if the scripts you omit have dependencies on things that Rocket Loader is still deferring you can cause more problems than you are solving. So it’s important to understand your website’s code and it’s dependencies / order of loading when you try this approach.

In any case, curious to see the problem in case it’s something we can fix.


#5

Thanks for the help.

So here is some better info if you’re trying to investigate. I’m using Chrome Desktop Browswer on macOS 10.13.4.

I’m using any page essentially listed under: https://cyberfmradio.com/site/index.html

The error in the console at the time that Rocket Loader is enabled is:
Uncaught TypeError: Cannot read property ‘__rocketLoaderProxiedHandler’ of undefined
at t.addEventListener (rocket-loader.min.js:1)
at R.e.haseventlistener._bind (jquery.nicescroll.min.js:82)
at R.bind (jquery.nicescroll.min.js:81)
at R.init (jquery.nicescroll.min.js:55)
at new R (jquery.nicescroll.min.js:109)
at HTMLHtmlElement. (jquery.nicescroll.min.js:118)
at Function.each (jquery.js:2)
at n.fn.init.each (jquery.js:2)
at n.fn.init.f.fn.niceScroll (jquery.nicescroll.min.js:117)
at HTMLDocument. (main.js:21)

After disabling Rocket Loader there are no errors in console at all. Hope this helps


#6

@james.tylee thanks for the information there - I can replicate now. We should have a fix for this in the next few days but I’ll confirm once this is done.


#7

#8

@james.tylee just to confirm this issue is now fixed :+1: