Hi, Thanks for the answer.
I'm trying to load blockly workspace from json, through
Blockly.serialization.workspaces.load() command.
And encounter this error.
TypeError: Invalid block definition for type: math_number
at new Block$$module$build$src$core$block (blockly_compressed.js:975:1)
at new BlockSvg$$module$build$src$core$block_svg (blockly_compressed.js:1227:1)
at WorkspaceSvg$$module$build$src$core$workspace_svg.newBlock (blockly_compressed.js:1645:1)
at appendPrivate$$module$build$src$core$serialization$blocks (blockly_compressed.js:184:1)
at appendInternal$$module$build$src$core$serialization$blocks (blockly_compressed.js:181:1)
...
I don't know what's wrong with the data:
{
"blocks": {
"languageVersion": 0,
"blocks": [
{
"type": "ha.be.Be.Start",
"id": "ttDi6Y1piNqKi!GKH=;f",
"x": 249,
"y": 198,
"inputs": {
"width": {
"shadow": {
"type": "math_number",
"id": "!n`U},x?W~b8S2S9fc;-",
"fields": {
"NUM": 320
}
}
},
"height": {
"shadow": {
"type": "math_number",
"id": "(i=R@FswM^]Ps$?-8bzQ",
"fields": {
"NUM": 240
}
}
},
"statementst": {
"block": {
"type": "variables_set",
"id": "?BBuRH-xfVFsVL#ivCx)",
"fields": {
"VAR": {
"id": "99*3xs_.J9FLSB`sp](v"
}
},
"inputs": {
"VALUE": {
"block": {
"type": "ha.be.Spr.Muat",
"id": "-Wwr3nwkx~$;z$;b1tzu",
"inputs": {
"url": {
"shadow": {
"type": "text",
"id": "tjz/~)*VQIRK@:47=aoI",
"fields": {
"TEXT": "./imgs/box.png"
}
}
}
}
}
}
}
}
}
}
},
{
"type": "ha.be.Be.Update",
"id": "D!_p@;(TK|!Jb;q9U}?k",
"x": 389,
"y": 333,
"inputs": {
"statementst": {
"block": {
"type": "ha.be.Be.Bersih",
"id": "(7d4VY9ISHI3=xQXw=c0",
"next": {
"block": {
"type": "ha.be.Spr.Gambar",
"id": "TKi]Pbe|YLS%b}yYe+1L",
"inputs": {
"sprite": {
"block": {
"type": "variables_get",
"id": "Oxp^k?rAe(XG%z7DGmrI",
"fields": {
"VAR": {
"id": "99*3xs_.J9FLSB`sp](v"
}
}
}
},
"x": {
"shadow": {
"type": "math_number",
"id": "iR^9X(~I02#.l.kt.[;:",
"fields": {
"NUM": 120
}
}
},
"y": {
"shadow": {
"type": "math_number",
"id": "Sn*[t/Kt[]3J~cg5t9-K",
"fields": {
"NUM": 100
}
}
}
}
}
}
}
}
}
}
]
},
"variables": [
{
"name": "image",
"id": "99*3xs_.J9FLSB`sp](v"
}
]
}
the math_number seems to have a correct structure.
I have many project saved as json and I'm affraid I cannot open in the new version.