Issues with Blockly 2.4.0

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

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

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

Thanks

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?

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

Best not to give you an untested bodged install then :slight_smile:

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

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

1 Like

I'm not clever - Bart's the clever one :slight_smile:
@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

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

1 Like

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

1 Like

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

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

1 Like

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

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?

Since I cannot reproduce this, I can only look at the Blockly code...
I assume this pull request has introduced our problem.

It fails on this line of code:

content.textContent = '';

Because content seems to be undefined in your case.
That variable is here defined when the DOM is being created:

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

I assume that will return 0 if you try this?

EDIT: I also get 1 if I look for its parent div element:
image
I am wondering if you perhaps also get 1 element here?

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

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.

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

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

image

1 Like

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 :exploding_head:

So I have registered at ticket.

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...