# Issues with Blockly 2.4.0

**URL:** https://discourse.nodered.org/t/issues-with-blockly-2-4-0/84982
**Category:** General
**Created:** [28 January 2024 08:15 UTC](https://discourse.nodered.org/t/issues-with-blockly-2-4-0/84982 "2024-01-28T08:15:00Z")
**Posts on this page:** 20
**Page:** 2

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [28 January 2024 14:51 UTC](https://discourse.nodered.org/t/issues-with-blockly-2-4-0/84982/21 "2024-01-28T14:51:23Z")

</div>

Absolutely not a problem - I'm chief tester for this node so we need to find out what's going on 🙂

---

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [28 January 2024 15:07 UTC](https://discourse.nodered.org/t/issues-with-blockly-2-4-0/84982/22 "2024-01-28T15:07:32Z")

</div>

I tried setting blockly dependency in package.json to 10.1.3 from ^10.1.3 and ran npm install from the node-red-contrib-blockly folder but got errors saying other dependencies needed 10.2.0

So I changed it 10.2.0 and issue disappeared on my Pi5

---

<div class="post-metadata">

### Author: ![magicman](https://avatars.discourse-cdn.com/v4/letter/m/73ab20/32.png) [@magicman](https://discourse.nodered.org/u/magicman)
#### Post date: [28 January 2024 15:12 UTC](https://discourse.nodered.org/t/issues-with-blockly-2-4-0/84982/23 "2024-01-28T15:12:22Z")

</div>

hi , @cymplecy  
Do i need to do this?  
if so can you talk me through what i have to do.?

Thanks

---

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [28 January 2024 15:14 UTC](https://discourse.nodered.org/t/issues-with-blockly-2-4-0/84982/24 "2024-01-28T15:14:31Z")

</div>

I don't know what the side effects are - this is pordding and pokiing at the moment

Is this your first go with the node or do you use it already?

---

<div class="post-metadata">

### Author: ![magicman](https://avatars.discourse-cdn.com/v4/letter/m/73ab20/32.png) [@magicman](https://discourse.nodered.org/u/magicman)
#### Post date: [28 January 2024 15:15 UTC](https://discourse.nodered.org/t/issues-with-blockly-2-4-0/84982/25 "2024-01-28T15:15:06Z")

</div>

First go but i love the idea and decided today to try it.

---

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [28 January 2024 15:22 UTC](https://discourse.nodered.org/t/issues-with-blockly-2-4-0/84982/26 "2024-01-28T15:22:39Z")

</div>

Best not to give you an untested bodged install then 🙂

Hopefully, we'll find out a root cause and get it sorted

@BartButenaers FYI Tried the same hack on my Mint VM and it also stopped the issue from happening

---

<div class="post-metadata">

### Author: ![magicman](https://avatars.discourse-cdn.com/v4/letter/m/73ab20/32.png) [@magicman](https://discourse.nodered.org/u/magicman)
#### Post date: [28 January 2024 15:32 UTC](https://discourse.nodered.org/t/issues-with-blockly-2-4-0/84982/27 "2024-01-28T15:32:24Z")

</div>

oh do not like the word hack lol..I will wait till you clever guys have it sorted 😉

---

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [28 January 2024 15:39 UTC](https://discourse.nodered.org/t/issues-with-blockly-2-4-0/84982/28 "2024-01-28T15:39:30Z")

</div>

I'm not clever - Bart's the clever one 🙂  
@BartButenaers - just trying previous releases 10.2.2 (from 9Oct2023) doesn't have the issue  
[edit] And just checked all my working instances and they are all running the blockly node at 10.2.2

---

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [28 January 2024 15:42 UTC](https://discourse.nodered.org/t/issues-with-blockly-2-4-0/84982/29 "2024-01-28T15:42:49Z")

</div>

@BartButenaers 10.3.0 (7dec2023) is first version that has the issue

---

<div class="post-metadata">

### Author: ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)
#### Post date: [28 January 2024 16:09 UTC](https://discourse.nodered.org/t/issues-with-blockly-2-4-0/84982/30 "2024-01-28T16:09:48Z")

</div>

Thanks Sherlock for analyzing this case!  
I will try tonight if I can reproduce it.

---

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [28 January 2024 16:29 UTC](https://discourse.nodered.org/t/issues-with-blockly-2-4-0/84982/31 "2024-01-28T16:29:59Z")

</div>

If you end doing a new version - please remember my outstanding PR 🙂

---

<div class="post-metadata">

### Author: ![magicman](https://avatars.discourse-cdn.com/v4/letter/m/73ab20/32.png) [@magicman](https://discourse.nodered.org/u/magicman)
#### Post date: [28 January 2024 16:33 UTC](https://discourse.nodered.org/t/issues-with-blockly-2-4-0/84982/32 "2024-01-28T16:33:02Z")

</div>

I nearly did not report this because I thought it was something i had done but glad i did now .

---

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [28 January 2024 17:16 UTC](https://discourse.nodered.org/t/issues-with-blockly-2-4-0/84982/33 "2024-01-28T17:16:05Z")

</div>

It was a good job you did - I'll have to update the original reported Github issue once its (hopefully) sorted

---

<div class="post-metadata">

### Author: ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)
#### Post date: [28 January 2024 21:40 UTC](https://discourse.nodered.org/t/issues-with-blockly-2-4-0/84982/34 "2024-01-28T21:40:23Z")

</div>

Unfortunately I can simply drag, drop, move blocks around without problems.

- Raspberry Pi 4
- Debian GNU/Linux 12 (bookworm)
- Chrome (Windows portable)
- Blockly version 10.3.1 (latest)
- Node-RED 3.1.3
- NodeJs 18.19.0

I would have expected to have the problem with this blockly version?

---

<div class="post-metadata">

### Author: ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)
#### Post date: [28 January 2024 22:05 UTC](https://discourse.nodered.org/t/issues-with-blockly-2-4-0/84982/35 "2024-01-28T22:05:34Z")

</div>

Since I cannot reproduce this, I can only look at the Blockly code...  
I assume [this](https://github.com/google/blockly/pull/7572) pull request has introduced our problem.

It fails on [this](https://github.com/google/blockly/blob/master/core/dropdowndiv.ts#L175) line of code:

```auto
content.textContent = '';

```

Because `content` seems to be undefined in your case.  
That variable is [here](https://github.com/google/blockly/blob/master/core/dropdowndiv.ts#L124) defined when the DOM is being created:

```auto
content = document.createElement('div');
content.className = 'blocklyDropDownContent';
div.appendChild(content);

```

When I enter the following statement in the console of my Chrome developer tools, I see that I indeed have _ **1** _ div element with that class:

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/5/4568bbff3e769fa253266ac65c57885c525ca082.png)

I assume that will return _ **0** _ if you try this?

EDIT: I also get 1 if I look for its parent div element:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/7/e73ba1b1b20a83d3433a415120306186a3702f26.png)  
I am wondering if you perhaps also get 1 element here?

---

<div class="post-metadata">

### Author: ![magicman](https://avatars.discourse-cdn.com/v4/letter/m/73ab20/32.png) [@magicman](https://discourse.nodered.org/u/magicman)
#### Post date: [28 January 2024 22:15 UTC](https://discourse.nodered.org/t/issues-with-blockly-2-4-0/84982/36 "2024-01-28T22:15:16Z")

</div>

hi @BartButenaers my node-red-contrib-blockly is V2.4.0 ? This was downloaded from the palette  
Nr is 3.1.3  
Node.js is 18.19.0

---

<div class="post-metadata">

### Author: ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)
#### Post date: [28 January 2024 22:18 UTC](https://discourse.nodered.org/t/issues-with-blockly-2-4-0/84982/37 "2024-01-28T22:18:32Z")

</div>

Yes mine too, since that is the latest version on npm. But Simon has played with the underlying blockly library, and with Blockly version 10.3.1 I would expect to get the same problem. I tried in expanded mode and normal mode, but cannot reproduce it.

---

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [29 January 2024 09:44 UTC](https://discourse.nodered.org/t/issues-with-blockly-2-4-0/84982/38 "2024-01-29T09:44:54Z")

</div>

Did you try editing the text block - that's when the issue arises as per the video here

> <https://github.com/bartbutenaers/node-red-contrib-blockly/issues/126#issue-2060535342>
>
> Hi, I just tried out the Blockly node and I like the concept. But I have the iss…ue you can see in the gif. When I click on something where I would expect a div switching for an editable component the node instead starts dragging and I can not drop it anymore without closing the editor. 
> 
> !\[Node\_Red\_Blockly\_Text\_Box\_Click\](https://github.com/bartbutenaers/node-red-contrib-blockly/assets/2019114/47b4a73b-b0b3-4367-887f-2311acc6a238)
> 
> The Javascript console gives the following error:
> !\[image\](https://github.com/bartbutenaers/node-red-contrib-blockly/assets/2019114/b646aa1e-70a4-4abd-a0f9-577b9d726e44)
> 
> NodeRed version is 3.1.3 and node-red-contrib-blockly at 2.4.0
> Happens with Firefox and Chrome. Any Ideas?

---

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [29 January 2024 10:28 UTC](https://discourse.nodered.org/t/issues-with-blockly-2-4-0/84982/39 "2024-01-29T10:28:08Z")

</div>

I'm not sure if I doing what you want correctly but I get this after the error

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/2/22e626664313f42f6a1e4cbc438199a1945d36cf.png)

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/9/e9e7ab6b55a8397add822acb20fbc6fdc192ee17.png)

---

<div class="post-metadata">

### Author: ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)
#### Post date: [29 January 2024 22:14 UTC](https://discourse.nodered.org/t/issues-with-blockly-2-4-0/84982/40 "2024-01-29T22:14:00Z")

</div>

Thanks to that animation, I finally was able to reproduce the problem.  
I have the impression that something about the DOM loading had changed in Blockly, because our elements are being cleaned up but not created anymore.  
No clue how to solve that 🤯

So I have registered at [ticket](https://groups.google.com/g/blockly/c/dikX9DqVaR0).

Hopefully the Blockly team can assist us.  
And hopefully it is not caused by our node recreating the workspace continiously, because it would take too much time for me to refactor a huge change like that...

[Previous page](https://discourse.nodered.org/t/issues-with-blockly-2-4-0/84982.md?page=1)

[Next page](https://discourse.nodered.org/t/issues-with-blockly-2-4-0/84982.md?page=3)
