# P5js web editor - assets folder

**URL:** <https://discourse.processing.org/t/p5js-web-editor-assets-folder/8863>\
**Category:** Coding Questions\
**Created:** [March 2, 2019, 7:04pm UTC](https://discourse.processing.org/t/p5js-web-editor-assets-folder/8863 "2019-03-02T19:04:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![boneman](https://avatars.discourse-cdn.com/v4/letter/b/c4cdca/32.png) [@boneman](https://discourse.processing.org/u/boneman)\
**Post date:** [March 2, 2019, 7:04pm UTC](https://discourse.processing.org/t/p5js-web-editor-assets-folder/8863/1 "2019-03-02T19:04:48Z")

</div>

SOLVED

The assets in the sketch folder don’t seem to be loading. The sketch hasn’t been edited for weeks, and was working fine until a couple days ago. I wonder if there is some sort of expiration date on the images in the assets folder?

Anyway, if you check the web browser’s console error log it shows all the images can’t be found. This is also strange because if I open the images inside the editor’s assets folder, they all appear just fine.

Any ideas? Let me know.  
-Matt

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [March 2, 2019, 7:55pm UTC](https://discourse.processing.org/t/p5js-web-editor-assets-folder/8863/2 "2019-03-02T19:55:29Z")

</div>

`bgIMG = loadImage('assets/bg.jpg');`

There’s no subfolder called “assets/”. Those images are all in the root folder. 📁

---

<div class="post-metadata">

**Author:** ![boneman](https://avatars.discourse-cdn.com/v4/letter/b/c4cdca/32.png) [@boneman](https://discourse.processing.org/u/boneman)\
**Post date:** [March 2, 2019, 7:58pm UTC](https://discourse.processing.org/t/p5js-web-editor-assets-folder/8863/3 "2019-03-02T19:58:15Z")

</div>

I followed the reference provided here, which also includes the assets folder: [https://p5js.org/reference/#/p5/loadImage](https://p5js.org/reference/#/p5/loadImage)

Again, it worked when I created the code weeks ago. It just recently failed to load. For this reason, the code that is written shouldn’t be an issue. But if it is, how would you write it?

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [March 2, 2019, 8:06pm UTC](https://discourse.processing.org/t/p5js-web-editor-assets-folder/8863/4 "2019-03-02T20:06:17Z")

</div>

> [@boneman](#):
>
> Again, it worked when I created the code weeks ago.

I don’t use that online editor. Got no idea why it woulda worked back then. 🤷‍♂️

> [@boneman](#):
>
> … how would you write it?

`bgIMG = loadImage('assets/bg.jpg');` ➡ `bgIMG = loadImage('bg.jpg');`

---

<div class="post-metadata">

**Author:** ![boneman](https://avatars.discourse-cdn.com/v4/letter/b/c4cdca/32.png) [@boneman](https://discourse.processing.org/u/boneman)\
**Post date:** [March 2, 2019, 8:08pm UTC](https://discourse.processing.org/t/p5js-web-editor-assets-folder/8863/5 "2019-03-02T20:08:36Z")

</div>

I see. I must have messed up when I tried that earlier, but you’re right it is in the root because I just tried it again and it worked. Well, sorry for wasting your time!
