# \[Bug report\] entry.delete()

**URL:** <https://forums.creativeclouddeveloper.com/t/bug-report-entry-delete/184>\
**Category:** UXP Plugin API\
**Tags:** api-feedback\
**Created:** [October 5, 2018, 1:08pm UTC](https://forums.creativeclouddeveloper.com/t/bug-report-entry-delete/184 "2018-10-05T13:08:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tullio](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/tullio/32/38_2.png) [@tullio](https://forums.creativeclouddeveloper.com/u/tullio)\
**Post date:** [October 5, 2018, 1:08pm UTC](https://forums.creativeclouddeveloper.com/t/bug-report-entry-delete/184/1 "2018-10-05T13:08:31Z")

</div>

From the docs:

```
entry.delete()
Removes this entry from the file system. If the entry is a folder, all the contents will also be removed

```

My code:

```
try{
    await entry.delete();
}catch(e){
    console.log(e);
}

```

Error:

```
[Error: Delete on non-empty folder not allowed]

```

I’m trying to delete a non empty folder according to the docs, but seems that you can’t.

---

<div class="post-metadata">

**Author:** ![kerrishotts](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/kerrishotts/32/8_2.png) [@kerrishotts](https://forums.creativeclouddeveloper.com/u/kerrishotts)\
**Post date:** [October 5, 2018, 2:59pm UTC](https://forums.creativeclouddeveloper.com/t/bug-report-entry-delete/184/2 "2018-10-05T14:59:05Z")

</div>

Looks like the docs are in error here; you first have to remove the entries within the directory first, before removing the entry. Thanks for the catch; we’ll update the docs!

---

<div class="post-metadata">

**Author:** ![tullio](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/tullio/32/38_2.png) [@tullio](https://forums.creativeclouddeveloper.com/u/tullio)\
**Post date:** [October 5, 2018, 9:14pm UTC](https://forums.creativeclouddeveloper.com/t/bug-report-entry-delete/184/3 "2018-10-05T21:14:52Z")

</div>

Yes this was my solution, I removed the entry first with folder.getEntries() and then the folder itself.  
Thanks

---

<div class="post-metadata">

**Author:** ![ptruskier](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/ptruskier/32/2844_2.png) [@ptruskier](https://forums.creativeclouddeveloper.com/u/ptruskier)\
**Post date:** [April 6, 2023, 10:28pm UTC](https://forums.creativeclouddeveloper.com/t/bug-report-entry-delete/184/4 "2023-04-06T22:28:19Z")

</div>

Just as a point of information, the docs STILL are not updated…
