Context Menu Not Opening

49 views
Skip to first unread message

Vítor Hugo

unread,
May 10, 2022, 1:12:00 PM5/10/22
to Blockly
Hello, everyone!

I'm using Blockly on my Angular Application, and I'm developing custom blocks that will be used inside the application.

I used to load Blockly through local files (followed this tutorial http://codedumpster.nithinbiliya.com/integrate-google-blockly-with-angular/) but recently changed to load blockly using npm, also upgrading its version to the latest one.

Now, when right-clicking a block to open its context menu, I'm getting the error shown in the image below and I can't find anywhere how to fix it. The context menu never shows up, I only get that error message.

Does anyone have any idea how to correct this error? Thank you.

error.png

Vítor Hugo

unread,
May 11, 2022, 9:11:33 AM5/11/22
to Blockly
Found a solution and posting in case someone finds this same problem in Angular/React.

If anyone is having the same problem with the latest versions, this is caused by the message strings. Some error in its loading was giving lots of console warnings as ``  No message string for %{BKY_MATH_ONLIST_TOOLTIP_STD_DEV} in %{BKY_MATH_ONLIST_TOOLTIP_STD_DEV} No message string for %{BKY_MATH_ONLIST_TOOLTIP_RANDOM} in %{BKY_MATH_ONLIST_TOOLTIP_RANDOM} ``, which I was ignoring.

Apparently it's a problem related to the loading of message files in Angular/React apps that use Blockly. [ https://github.com/google/blockly/issues/4369 ]

It ends up causing this 'Context Menu' error because it can't get the strings for the menu's options.

Luckily, I found that this was fixed in version 8.0.1.-beta.0, so specifying that version in the package.json and then running the npm-intall command solved the problem. However, the same patch that solves this problem wasn't pushed to version 8.0.1 or 8.0.2, as can be seen in the image relating to issue from the link above.
sol.png
Reply all
Reply to author
Forward
0 new messages