# Cleaning up monaco models left behind

**URL:** https://discourse.nodered.org/t/cleaning-up-monaco-models-left-behind/63500
**Category:** Developing Nodes
**Created:** [6 June 2022 04:55 UTC](https://discourse.nodered.org/t/cleaning-up-monaco-models-left-behind/63500 "2022-06-06T04:55:08Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![nileio](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nileio/32/9444_2.png) [@nileio](https://discourse.nodered.org/u/nileio)
#### Post date: [6 June 2022 04:55 UTC](https://discourse.nodered.org/t/cleaning-up-monaco-models-left-behind/63500/1 "2022-06-06T04:55:08Z")

</div>

Hi Team,

I have a custom node and the following note is constantly printed on the console

> Cleaning up monaco models left behind. Any node that calls createEditor() should call .destroy().

seems to be coming from red.js line 35905 (handling orphaned models)

I can confirm that my custom node calls `editor.destory()`. I tried to do that on both `oneditsave`, and `oneditcancel` fuctions.

```auto
this.editor.destroy();
delete this.editor;

```

It might be that the check on `red.js` does not correctly check for the existence , I dont know, or perhaps I am doing something wrong.  
This is not an issue but just thought to report it given there is a plan to move to use monaco only.

```auto
Node-RED version: v2.1.4
Node.js version: v13.10.1

```

Cheers

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [6 June 2022 08:19 UTC](https://discourse.nodered.org/t/cleaning-up-monaco-models-left-behind/63500/2 "2022-06-06T08:19:38Z")

</div>

> [@nileio](#):
>
> I have a custom node and the following note is constantly printed on the console
> 
> > Cleaning up monaco models left behind. Any node that calls createEditor() should call .destroy().

This message is to indicate "some node" in your installation is not cleaning up after itself. It does not necessarily mean it is your node. What other nodes do you have installed?

Also, node-red 2.1.4 is getting on a bit now and might have some resolved issue in newer 2.2.2 or V3.beta.2

---

<div class="post-metadata">

### Author: ![nileio](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nileio/32/9444_2.png) [@nileio](https://discourse.nodered.org/u/nileio)
#### Post date: [6 June 2022 09:07 UTC](https://discourse.nodered.org/t/cleaning-up-monaco-models-left-behind/63500/3 "2022-06-06T09:07:16Z")

</div>

Yea this makes sense. Thanks for reply It might be a different node that I have installed. I have many other nodes so I suppose I will try find which one causing this issue.  
It would have been great if the message indicates which node though. it would be nice to have.

I will possibly upgrade soon too.

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [6 June 2022 09:52 UTC](https://discourse.nodered.org/t/cleaning-up-monaco-models-left-behind/63500/4 "2022-06-06T09:52:37Z")

</div>

Also, you are probably aware, but just in case not. Odd numbered versions of Node.js should generally be avoided for normal use since they tend to be relatively unstable development versions. Most people and the Node-RED project recommend using one of the current LTS versions.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [5 August 2022 09:52 UTC](https://discourse.nodered.org/t/cleaning-up-monaco-models-left-behind/63500/5 "2022-08-05T09:52:50Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
