# Broken JavaScript Issues?

**URL:** <https://community.hubspot.com/t/broken-javascript-issues/133389>\
**Category:** CMS Development\
**Tags:** javascript\
**Created:** [May 27, 2025, 8:13am UTC](https://community.hubspot.com/t/broken-javascript-issues/133389 "2025-05-27T08:13:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![HBarden](https://avatars.discourse-cdn.com/v4/letter/h/278dde/32.png) [@HBarden](https://community.hubspot.com/u/HBarden)\
**Post date:** [May 27, 2025, 8:13am UTC](https://community.hubspot.com/t/broken-javascript-issues/133389/1 "2025-05-27T08:13:38Z")

</div>

Hi,

I’m getting these issues pop up regarding broken JavaScript on my audits. They haven’t been there before and are there now?

I don’t believe I’ve changed anything significantly recently, could anyone advise what they are and how to fix these please? I’ve attached screenshot.

 ![Screenshot 2025-05-27 091100.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/b/0/b0395b7385bc73cbeeb87c18262a792df8de9457.png)

---

<div class="post-metadata">

**Author:** ![Anton](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/anton/32/103167_2.png) [@Anton](https://community.hubspot.com/u/Anton)\
**Post date:** [May 27, 2025, 8:43am UTC](https://community.hubspot.com/t/broken-javascript-issues/133389/2 "2025-05-27T08:43:41Z")

</div>

Hi @HBarden,

thanks for providing the screenshot.

Status code 200 means, everything is good and loaded. So no need to worry here.

An 400-ish error (mostly 404) is an error, but 200 is totally fine.

Do you have some of those somewhere?

best,

Anton

---

<div class="post-metadata">

**Author:** ![HBarden](https://avatars.discourse-cdn.com/v4/letter/h/278dde/32.png) [@HBarden](https://community.hubspot.com/u/HBarden)\
**Post date:** [May 27, 2025, 2:16pm UTC](https://community.hubspot.com/t/broken-javascript-issues/133389/3 "2025-05-27T14:16:15Z")

</div>

Hi Anton,

Thank you for getting back to me. Nope, all 200s.

I’m unsure why these have suddenly flagged up on my AHREF’s site audit as it’s brought our overall health score from 98 to 74.

Is there anything to worry about? Thanks.

---

<div class="post-metadata">

**Author:** ![Anton](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/anton/32/103167_2.png) [@Anton](https://community.hubspot.com/u/Anton)\
**Post date:** [May 28, 2025, 9:55am UTC](https://community.hubspot.com/t/broken-javascript-issues/133389/4 "2025-05-28T09:55:07Z")

</div>

Hey @HBarden,

my guess is that [AHREF changed their algorithm](https://ahrefs.com/google-algorithm-updates). This is something very common, as most performance providers (like AHREFs, SEMRush …) are build upon [Lighthouse](https://developer.chrome.com/docs/lighthouse) (Google’s “performance” service). And as Google constantly changes something in their tool(s), it’s very common that results may vary quite frequently and are not 100% precise.

Just an example - if you test your page with Googles own [pagespeed tester,](http://pagespeed.web.dev) you’ll most likely get (slightly) different results almost every time. 🙂

But: If you change something on your page like moving scripts/images/media from a to b, it can have an impact on the result.

If your score drops drastically for over 40 points, I’d be concerned, but 20-ish points is something that can resolve itself over a few days.

For instance: [GraphiSpot](https://graphispot.com) (my website; build on HubSpot) had 99-100 points in every metric on pagespeed tester while developing and the first few weeks after launch. Then it dropped to 70-ish in performance, but everything else stayed on 99/100. A few days later it was back at 99 again.

Something I see in [your report](https://pagespeed.web.dev/analysis/https-ame-3d-co-uk/33beosgvrv?form_factor=desktop) is that your performance can be optimized. Especially the whole JavaScript loadings and extremly huge images are impacting the performance.

**For JavaScripts:**

Optmizing JS can be quite a task, but my main recommendations are:

Try minifying the scripts (don’t do this in the live environment as this can cause a lot of trouble), adding async/deffered loadings and optimizing the them, pages and portal to only load the needed scripts for the requested page

**For images - A few rule-of-thumb(s):**

- an individual image shouldn’t exceed 200kbyte (Hero’s can be an exception)
- use lazy-loading on all images “below-the-fold”
- If you know that the used image will be in a 4 column grid and your container/content width is 1600px - there’s no need to let the image be wider than 400px. _ **The math formula:** CONTENT\_WIDTH / NUMBER\_OF\_COLUMNS = IMAGE\_WIDTH._
- If you don’t have specific images for “mobile only”, the min-width of an image should be around 350px (icons are exceptions)
- SVGs are excluded from these, as they’re scalable and most times super light-weight

best,

Anton
