# Image not loading

**URL:** <https://phaser.discourse.group/t/image-not-loading/5401>\
**Category:** Phaser 3\
**Created:** [March 5, 2020, 4:51am UTC](https://phaser.discourse.group/t/image-not-loading/5401 "2020-03-05T04:51:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![eric](https://avatars.discourse-cdn.com/v4/letter/e/898d66/32.png) [@eric](https://phaser.discourse.group/u/eric)\
**Post date:** [March 5, 2020, 4:51am UTC](https://phaser.discourse.group/t/image-not-loading/5401/1 "2020-03-05T04:51:27Z")

</div>

I am trying to get an image to appear on the screen, but all that shows is the green box with the slash through it. I have

```
this.load.image('ace', 'assets/ace.png');

```

in my ‘create()’ function, and

```
this.add.image(100, 100, 'ace');

```

in my ‘update()’ function. As I said, the green box shows at coordinates (100, 100)…why isn’t the image loading? I’ve tried every file path I can think of (e.g. ‘./assets/ace.png’, ./src/assets/ace.png’, etc.) but nothing works. My file structure is

```
index.html
src/
    index.js
    assets/
        ace.png

```

Any help is much appreciated!

---

<div class="post-metadata">

**Author:** ![eric](https://avatars.discourse-cdn.com/v4/letter/e/898d66/32.png) [@eric](https://phaser.discourse.group/u/eric)\
**Post date:** [March 5, 2020, 4:58am UTC](https://phaser.discourse.group/t/image-not-loading/5401/2 "2020-03-05T04:58:34Z")

</div>

Also, I would put the loading in a preload function but for some reason it is erroring, saying my preload is undefined…which doesn’t make any sense to me either because my scene includes it

```
scene: {
    preload: preload,
    create: create,
    update: update
}
```

---

<div class="post-metadata">

**Author:** ![eric](https://avatars.discourse-cdn.com/v4/letter/e/898d66/32.png) [@eric](https://phaser.discourse.group/u/eric)\
**Post date:** [March 5, 2020, 5:15am UTC](https://phaser.discourse.group/t/image-not-loading/5401/3 "2020-03-05T05:15:30Z")

</div>

I sort of solved my problem…

I had my config object created in a different module, but did not import the preload() function for the scene to access.
