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.
Written by Jeff Escalante
Related protips
1 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.
Have a fresh tip? Share with Coderwall community!
JavaScript on a page runs with the privileges of that origin. One altered library, tag manager, or snippet can read inputs, change what people see, and call your APIs as the user.
Security insights from Cside