Uncaught SyntaxError: forum spins nonstop and never loads

Hoping someone here can point me in the right direction. As titled, our forum at forum.wackywriters.com spins and never loads. Console shows this series of errors:

Mostly Uncaught Syntax Error, though there is a “jQuery is not defined” a little later (total of 46 errors). This started today without any warning or updates on my part, so not sure what triggered it.

Troubleshooting I’ve tried:

  • Rebuild, rebuild, rebuild.
  • Run cleanup, rebuild again
  • Safe mode disabling ALL themes and plugins (official or not). I can get to the safe mode page, but upon entering it I get the same errors.
  • I am behind Cloudflare (yes, I know) and confirmed brotli compression was up and working. Purged the cache over there and bypassed their regular caching (development mode) to make sure everything’s working on their end. Cloudflare template is active in app.yml. Setting to DNS only or disabling Cloudflare entirely throws an insecure error (SSL certs are through them).
  • Confirmed DigitalOcean wasn’t having any issues.
  • Rebuild again for good measure.

What’s interesting is there are no errors (from today) in the logs. I can reach the site, but something between getting there and accessing the full Discourse forum is sending the site into meltdown mode.

The only thing that has changed in the last week was me updating my Font Awesome Pro license key in app.yml, but that was a few days ago. Forum didn’t start doing this until today. Can anybody think of something else I could try to troubleshoot this (short of disabling CF completely or restoring from a backup)? I’ve been working on this for hours today with zero success. Can provide more screenshots or my redacted app.yml file if someone thinks those will help.

1 Like

Update: I bit the bullet and nuked Cloudflare just to rule it out, then also restored a backup. Still having the same issue.

I don’t see the errors from your screenshot, but I see an error about the discourse-layouts plugin. Try rebuilding without that?

1 Like

The errors I’m seeing in my console when I attempt to load the site in safe mode (Wacky Writers) are interesting. Things like:

Invalid or unexpected token at https://storage.wackywriters.com/assets/browser-detect-99f42f91bffa8ca1606d62b70bb92f981d83921e78ccdbd3d9538f07007f27ac.br.js

The file at https://storage.wackywriters.com/assets/browser-detect-99f42f91bffa8ca1606d62b70bb92f981d83921e78ccdbd3d9538f07007f27ac.br.js doesn’t look like javascript to me.

I’m assuming it’s a mangled version of this file: https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/scripts/browser-detect.js, but that’s just a guess.

Maybe try removing plugins from your app.yml file and rebuilding?

1 Like

yes could be something in there. maybe a plug-in or something that’s causing an issue even in safe mode.

:point_down:t2:

1 Like

Yeah at this point in time I’m tearing down everything to brass tacks and trying to see if a clean install throws the same errors.

I commented out all plugins and rebuilt with the same issue.

My best guess is something isn’t parsing correctly. I actually cleared out all assets and did a rebuild to regenerate them with the same issue.

Yep, I thought that too and commented out all plugins only to get the same errors.

2 Likes

Cloudflare rocketloader is an issue and breaks Discourse.

1 Like

Yeah for sure, it’s why I moved us out from behind them and just set up normal DNS to rule that out.

1 Like

Of course now I’m waiting for DNS to propagate and all the updated LetsEncrypt certs to sort themselves out so a new layer of complication till that all updates. :joy:

2 Likes

If that doesn’t sort things out, it might be worth purging your CDN. I think it’s on digitaloceanspaces.com. It seems that it’s serving corrupt files. For example: https://storage.wackywriters.com/assets/start-discourse-7c0f5f4daf3c942b7b6ecfe8e62e2e5a0f6555924859cf055314c0df3d617353.br.js.

5 Likes

Oh thanks, I’ll try that. I purged on Cloudflare but not DO Spaces :thinking:

1 Like

I think you may be onto something based on this topic here: S3, Assets & CDN Error

3 Likes

Seriously, I could hug you. The issue did indeed lie with DO Spaces, specifically their CDN as mentioned here: Configure an S3 compatible object storage provider for uploads

I set up a new CDN via bunny.net and now we’re tentatively up and running again. Still gotta get my backups in order and fix some of the broken images but this is the closest I’ve gotten us back to functional all day haha. Thank you thank you! I’ve had our spaces setup running via that CDN/S3 configuration for…gosh, 2 years now or something. I’m probably lucky it hasn’t broken before now.

5 Likes