# SLS exports a deleted screen and breaks compilation

**URL:** <http://forum.squareline.io/t/sls-exports-a-deleted-screen-and-breaks-compilation/2604>\
**Category:** Bugs\
**Created:** [March 2, 2024, 12:43pm UTC](http://forum.squareline.io/t/sls-exports-a-deleted-screen-and-breaks-compilation/2604 "2024-03-02T12:43:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bruno](http://forum.squareline.io/letter_avatar_proxy/v4/letter/b/c77e96/32.png) [@bruno](http://forum.squareline.io/u/bruno)\
**Post date:** [March 2, 2024, 12:43pm UTC](http://forum.squareline.io/t/sls-exports-a-deleted-screen-and-breaks-compilation/2604/1 "2024-03-02T12:43:34Z")

</div>

### What do you want to achieve?

Export my current project with a deleted screen and have all corresponding code removed from the generated code.

### What have you tried so far?

Exporting, deleting and re-creating the screen with the exact same name

### Details

Error:

```e
src/ui/ui.c: In function 'ui_event_home_tbns':
src/ui/ui.c:450:27: error: 'ui_screen_settings' undeclared (first use in this function); did you mean 'ui_screen_pos'?
       _ui_screen_change( &ui_screen_settings, LV_SCR_LOAD_ANIM_MOVE_BOTTOM, 200, 0, &ui_screen_settings_screen_init);
                           ^ ~~~~~~~~~~~~~~~~~
                           ui_screen_pos

```

SLS declared screens

 ![image](http://forum.squareline.io/uploads/default/original/2X/4/4a555c12f3a6f4dfc59433f76d82b8d35ca3d11c.png)

It looks like SLS mirrors screen config somewhere and does not clean the corresponding data / cache / structure when deleting a screen, thus exporting a ghost, deleted screen and pollutes code with missing screen declarations.

### Others

- **SquareLine Studio version:** 1.3.4
- **Operating system:** MacSO Sonoma
- **Target hardware:** ESP32-S3

---

<div class="post-metadata">

**Author:** ![dingrls](http://forum.squareline.io/letter_avatar_proxy/v4/letter/d/b77776/32.png) [@dingrls](http://forum.squareline.io/u/dingrls)\
**Post date:** [March 3, 2024, 4:00pm UTC](http://forum.squareline.io/t/sls-exports-a-deleted-screen-and-breaks-compilation/2604/2 "2024-03-03T16:00:02Z")

</div>

Are you using Arduino IDE?

I was getting this problem too when I renamed a screen and exported the new UI files. During the compile, there were strange error references to the old screen name. However, a search of all the UI and .ino sketch files showed no trace of the old screen name.

I was able to get around this problem by saving the sketch in Arduino IDE with a new sketch name. Then all traces of the problem vanished.

Bottom line: I am not sure if the problem lies with SLS or with Arduino IDE. But I suspect it might be in the Arduino IDE retaining old ghosts in its cache closet.

---

<div class="post-metadata">

**Author:** ![Hermit](http://forum.squareline.io/user_avatar/forum.squareline.io/hermit/32/971_2.png) [@Hermit](http://forum.squareline.io/u/Hermit)\
**Post date:** [March 4, 2024, 7:32am UTC](http://forum.squareline.io/t/sls-exports-a-deleted-screen-and-breaks-compilation/2604/3 "2024-03-04T07:32:12Z")

</div>

In the new 1.4.0 version of SquareLine Studio the old screens that are not referenced anymore by the project, are deleted from the UI-export folder upon exporting the UI or the template project.
