# Assets only available to SCSS not JS

**URL:** <https://meta.discourse.org/t/assets-only-available-to-scss-not-js/148231>\
**Category:** Development\
**Created:** [16 באפריל,‏ 2020,‏ 11:59am UTC](https://meta.discourse.org/t/assets-only-available-to-scss-not-js/148231 "2020-04-16T11:59:43Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)\
**Post date:** [16 בדצמבר,‏ 2021,‏ 10:27am UTC](https://meta.discourse.org/t/assets-only-available-to-scss-not-js/148231/4 "2021-12-16T10:27:02Z")

</div>

Ah, I was missing the assets folder in my path to the asset, so the broken link had “optimised out” the asset no doubt:

```plaintext
{
  "name": "Cool Theme Component",
  "about_url": "",
  "component": true,
  "assets": {
    "background": "background.png"
  }
}

```

should have been:

```plaintext
{
  "name": "Cool Theme Component",
  "about_url": "",
  "component": true,
  "assets": {
    "background": "assets/background.png"
  }
}

```

Doh!

FYI I’m reference this in Javascript in an Ember Component, e.g.:

```plaintext
  @computed
  backgroundImage() {
    return settings.theme_uploads.background;
  }

```

That would raise an `undefined` error when the path is incorrect!

Thanks for listening! @david, sorry to waste your time.

@hakonbja did you solve your issue?

---

_[View the full topic](https://meta.discourse.org/t/assets-only-available-to-scss-not-js/148231)._
