Cloudflare breaking JS and CSS

Javascript is loading incorrectly. Cant do speedtest (On Cloudflare Page) because it responds with status 503. The page will load sometimes but not others. Half loads alot but doesn’t show login form. Going to a different page on the site will load form but not js.

When I look in console Im getting these errors:

Visiting the site on locally and not going through cloudflare works perfect. Nothing wrong, no errors, no slow loading. Problem must be with cloudflare but not sure what it is.

Expectation:

Reality:

1 Like

For starters, if you’re using Rocket Loader in the Speed → Optimization settings page, try turning it off.

I don’t think there’s a CSS error in your screenshot.

Rocket Loader is disabled. CSS isnt the problem, realizing that now. CSS is okay its just Javascript that isn’t working.

1 Like

It’s been a while (and I thought the problem went away), but have you looked in your browser’s Dev Tools (Network Tab) to look at the response for those JS files to see if the entire file is there? Some people had a problem with JS files getting cut off.

It’s possible that putting your site into Development Mode from the Overview page will pull the original JS files from your server if this is a similar problem.

Indeed it does. Development mode is currently fixing all my issues. Switching back from development mode brings back my issues. While it’s not in development mod it doesn’t look like I’m getting any problems in the Network Tab. I could be missing something let me know if so. Thank you.

While dev mode is enabled I am getting a few errors. Not sure if this is normal but here you go anyways.

EDIT: According to cloudflare, Development mode enabled or disabled, I’m still getting status 503 in the speedtest tab.

I wouldn’t worry about the Speed Tab. There are many reasons for a test not running, and that test isn’t the best way to measure performance.

If Dev Mode makes it better, try Purge Cache (Everything) and turn Dev Mode off. It could just be a corrupted cache that you’d need to keep an eye on.

For reference (just in case), this is the thread I was thinking of, but Dev Mode didn’t fix it. It was some bug that they fixed:
https://community.cloudflare.com/t/cloudflare-frequently-returning-incomplete-files-to-browsers/305247/

As much as I hoped that was the case it wasn’t. Purged Cache (Everything) and turned off Dev mode and no results.

Ill check out the edit you just made

Saw a post saying to clear browser cache. That seems to have removed the div that holds form. I am back down to the image loading and sometimes not.

  • Quick recheck and it seems the div holding the form loads again. Nothing else sadly

How about…minify? Do you have any of that toggled in Speed → Optimization? (I’m just thinking of the things Dev Mode disables).

I did have minify enabled however disabling it and purging cache had no effect.

Yet Dev Mode makes all of it work? Most of it? And make sure you force refresh your browser while testing.

Back to your first first image with the SyntaxErrors, have you looked at those .js files during an error to see if the entire file was downloaded by the browser?

This could be similar to that other issue and would need Support to look at it. It’s getting late for me, but if can’t make any headway, I suggest you open a ticket via email to: support AT cloudflare DOT com and then post the ticket number here as soon as you get the autoreply.

Dev Mode makes everything work and leaves nothing out. Compared source files for main webpage locally and through cloudflare. It does seem to remove some lines from the source and edit it a little. This could be the issue. Creating the ticket now.

50 Lines


Compared to the 61 I get (removing the spaces from source).

That sure looks minified to me. Leave JS Minification disabled, and make sure you’re not setting it in a Page Rule, either. Purge Everything, Force Reload in your browser.

Yes I agree. I have my auto minify disabled and I currently have no Page Rules. Have purged 3 times since I had it disabled (20 minutes ago). Still no luck sadly.
P.S. Been force reloading throughout this entire process

Edit: I have submit a support ticket and am currently waiting on the ticket number

Last update then I’m going to sleep on it, sadly have not received ticket number yet. Will post ticket number early tomorrow. It seems that my problem is the login div is not present at all from what I can see in inspect element. This div holds the login form which in turn is the reason why it isn’t displaying correctly. However that still doesn’t explain the incorrect formatting of the admin page (https://connect.rootvpn.ga/admin). You’ve been a lot of help get some sleep and maybe it’ll solve itself :wink:

Those .js files aren’t js files. They’re showing the HTML content of the home page.

something is delivering the wrong content. Do you have any Workers?

One odd thing is that several times when I do a Force Reload, it’d get stuck in a redirect loop. It would loop between /admin/ and /admin/session_start/

Which SSL mode are you using for your domain?

This is not a permanent solution and not much of one anyways but bypassing cache seems to be doing the trick. Adding a pagerule to bypass cache on the domain fixes all my problems

*** Ive hit my daily limit of posts.

I have the same problem !!!

How about putting in the full URL for your scripts here: