New Block Definition in new File

17 views
Skip to first unread message

Mr. MoGa

unread,
Jul 7, 2022, 3:54:36 AM7/7/22
to Blockly
When I create a custom Block using the Blockly Factory and then use the code in an existing File under blockly/blocks/ and blockly/generators, everything works correctly.
However when i create new Files for a new Toolbox Category, the block doesnt show up. The categories are created correctly but the blocks within them aren't present.

Beka Westberg

unread,
Jul 11, 2022, 12:53:25 PM7/11/22
to Blockly
Hello,

There's likely an issue with how your block definitions and generators are being imported. The scripts or modules or modules that include those definitions need to be loaded before the workspace is injected and the toolbox is created.

If you post your main module entrypoint (if you're using a module system) or your html file (if you're importing using script tags). I might be able to point out what needs to be rearranged =)

Best wishes,
--Beka

Reply all
Reply to author
Forward
0 new messages