cannot use custom blocks without category

Skip to first unread message


Nov 28, 2021, 4:46:40 AM11/28/21
to Blockly
Hi everyone,
I am wanting to have a toolbox with no category and custom blocks however when is use a custom block outside of a category i get the block events is not defined error even when it is.
For example when i use this toolbox XML:
<xml xmlns="" id="toolbox" style="display: none">
  <block type="events">
    <field name="NAME">pfl</field>
  <block type="colour_random"></block>
I get this error:
Screenshot 2021-11-28 10.44.53 AM.png
But when i use a toolbox with the standard blocks e.g. the random color block and the XML: <xml xmlns="" id="toolbox" style="display: none">
  <block type="colour_random"></block>
it just works as expected.
is there any reason for this or a way to fix this?

Beka Westberg

Nov 28, 2021, 2:46:20 PM11/28/21
Hmmm well it seems like Blockly is having trouble finding your block definition. Where are you defining the 'events' block? If it's in a different file, how are you importing it?

Once we have a bit more information I'm sure someone here can help you out =)

You received this message because you are subscribed to the Google Groups "Blockly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit


Nov 28, 2021, 3:07:55 PM11/28/21
to Blockly
Thanks for writing back Beka!
Note: I removed the toolbox XML else i couldn't work on other stuff.
Second note: the block is defined in the blocks function.
Op zondag 28 november 2021 om 20:46:20 UTC+1 schreef


Nov 29, 2021, 1:25:25 PM11/29/21
to Blockly
The issue has been resolved had to place the blocks before injection.

Op zondag 28 november 2021 om 21:07:55 UTC+1 schreef Sketch:
Reply all
Reply to author
0 new messages