Last Updated: November 17, 2017
·
2.957K
· jenius

cloudflare + require.js = : (

At the moment, cloudflare with 'full speed optimizations' is incompatible with requirejs. If you are using both on your site, it will kill your js loads.

The reason for this is that cloudflare injects a small script on the site called 'rocket loader', which, if I'm not mistaken, tries to do the same thing as require -- loading blocking script tags as async after window.onload. A part of this script adds a global define variable, which messes with requirejs and causes all require loads to fail.

The way to fix this is to turn off 'full optimizations' in the cloudflare settings for your site. As soon as you do this, your javascript will be back to happy.

1 Response
Add your response

Did you already just try disabling Rocket Loader? It's extremely unlikely you can't use any of our service -- it's almost certainly just Rocket Loader conflicting some how.

over 1 year ago ·