mo4islona / node-blockly

Blockly for Node.js and Browser via CommonJS module
133 stars 81 forks source link

How to import custom blocks and generate code? #26

Closed rtu-dataframe closed 6 years ago

rtu-dataframe commented 6 years ago

Hi, i've tried to import custom blocks using the "Import" directive in Node (I'm not a Node.js guru...), then load my XML and finally i've tried to generate my Python Code, but i'm receiving this error:

> Blockly.Python.workspaceToCode(workspace);
TypeError: Cannot read property 'call' of undefined
    at module.exports.Blockly.Generator.blockToCode

Do you know why? it's possible to import custom blocks definition and imports on your Node Module?

Thanks.

rtu-dataframe commented 6 years ago

Solved by importing the stubs and custom code blocks via the require statement

LarryKlugerDS commented 4 years ago

Hi @Simonefardella ,

Can you provide an example of the code you used?

Thanks, Larry