I spent abut 24hrs trying to figure out why my script did not work on my production server. when i tried it on my local server it worked great.

i uploaded my site to the production server. my script contained angularsjs, which is heavy on javascript.

once i uploaded, it worked beautiful. but i wanted to make it secured. so i changed the url to https://

thats when things turn south. all my angular did not work. i looked at my javascript file, everything was ok, so after troubleshooting for hours, i finally figure out what the issue was..

you see, cloudflare shrinks your javascrit and css files, which means it removes all the notes. i make alot of notes on my script. usually when i make a note, i use this format: // my notes

so when cloudflare Minify my files, their script tries to do its best, but there are exception of course, and i am that exception. i have many objects on my javascript and in between my objects, i put notes for example:

var object = {
'foo' : 'bar', // this is a note
'bar' : 'foo'
}


when their Rocket Loaderâ„¢ tries to minify my script, it shrinks it to something like this:
var object = {'foo' : 'bar', // this is a note'bar' : 'foo' }


this is not going to work. so to fix it, i could have just removed all my notes, but i didn't want to, my notes are valuable to me, so i logged into their control panel and under the 'speed' icon, there are two options you need to change:

the first one is under SPEED > Auto Minify > unselect []Javascript

the second choice under SPEED > Rocket Loaderâ„¢ > select Off

now, clear your browser cache, give it about 2 minutes for the changes you made to take affect and refresh your page, you will see it works now.

hope it helps