Hi!
I updated Blockly from 7.20211209.4 to 9.0.0.
Now I've got an error: Blockly.Puthon is undefined.
This is the way my blocks was defined:
Blockly.Blocks['can_forward'] = {
init: function() {
let input = this.appendDummyInput('can_forward')
.appendField(this.getText('can_forward'))
input.getText = () => this.getText('can_forward')
this.setColour('#838CD8')
this.setTooltip('')
this.setHelpUrl('')
this.setPreviousStatement(false)
this.setNextStatement(false)
this.setOutput(true, 'Boolean')
}
}
Blockly.Python['can_forward'] = function(block) {
return [Blockly.getCode('can_forward') + "()", Blockly.Python.ORDER_NONE]
}
`getText` -- is some custom method for Block, doesn't matter.
The problem is (at line with Blockly.Python):
TypeError: Cannot set properties of undefined (setting 'can_forward')
What am I doing wrong?