# System error (Javascript)

**URL:** <https://forum.makecode.com/t/system-error-javascript/40771>\
**Category:** Help\
**Tags:** javascript\
**Created:** [December 4, 2025, 5:59pm UTC](https://forum.makecode.com/t/system-error-javascript/40771 "2025-12-04T17:59:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![BiiTheBee](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/biithebee/32/27076_2.png) [@BiiTheBee](https://forum.makecode.com/u/BiiTheBee)\
**Post date:** [December 4, 2025, 5:59pm UTC](https://forum.makecode.com/t/system-error-javascript/40771/1 "2025-12-04T17:59:05Z")

</div>

I keep getting this error saying:

“Cannot read properties (reading "\_width”)

I don’t know what’s causing it, I checked with Gemini (our school doesn’t allow any other) and he doesn’t help.

Code: [https://arcade.makecode.com/S69775-13061-06736-37658](https://arcade.makecode.com/S69775-13061-06736-37658)

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [December 4, 2025, 7:24pm UTC](https://forum.makecode.com/t/system-error-javascript/40771/2 "2025-12-04T19:24:20Z")

</div>

@BiiTheBee this is happening because of how you are referencing your assets. you can’t call `assets.image()` like a function, it’s meant to be used as a tagged template literal like this:

```auto
assets.image`imageName`

```

if you do want to look up the images programmatically by name like you’re doing, use `helpers.getImageByName()` instead

edit: fixed the function name (`getImageByName` is in the helpers namespace, not assets)

---

<div class="post-metadata">

**Author:** ![BiiTheBee](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/biithebee/32/27076_2.png) [@BiiTheBee](https://forum.makecode.com/u/BiiTheBee)\
**Post date:** [December 4, 2025, 8:01pm UTC](https://forum.makecode.com/t/system-error-javascript/40771/3 "2025-12-04T20:01:35Z")

</div>

I updated my code but the error still occurs, maybe it has something to do with the image?

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [December 4, 2025, 8:02pm UTC](https://forum.makecode.com/t/system-error-javascript/40771/4 "2025-12-04T20:02:26Z")

</div>

@BiiTheBee it works for me:

> **[rapping game](https://arcade.makecode.com/18977-89869-57639-28436)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

are you sure you replaced it everywhere?

---

<div class="post-metadata">

**Author:** ![MeatballDev](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/meatballdev/32/28502_2.png) [@MeatballDev](https://forum.makecode.com/u/MeatballDev)\
**Post date:** [December 4, 2025, 10:18pm UTC](https://forum.makecode.com/t/system-error-javascript/40771/5 "2025-12-04T22:18:13Z")

</div>

makecode has its own type of javascript that ai doesnt know, you would have to train the ai how to use makecode
