You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Headless workspaces require a theme to be defined, even though they are not rendered.
Expected Behavior
I can create themed blocks on a headless workspace.
Actual Behavior
I recieve an error.
Steps to Reproduce
Disable the changeTheme function of the playground.
Remove all of the code from the start function and replace it with the below:
var altWorkspace = new Blockly.Workspace();
// JSON block def.
var block = new Blockly.Block(altWorkspace, 'controls_if');
// JS block def.
var block = new Blockly.Block(altWorkspace, 'text_getSubstring');
Stack Traces
block.js:1520 Block "controls_if": Style does not exist: logic_blocks
Blockly.Block.jsonInitStyle_ @ block.js:1520
Blockly.Block.jsonInit @ block.js:1426
(anonymous) @ blockly.js:414
Blockly.Block @ block.js:181
start @ playground.html:146
onload @ playground.html:429
block.js:975 Uncaught Error: Trying to set block style to text_blocks before theme was defined via Blockly.setTheme().
at Blockly.Block.setStyle (block.js:975)
at Blockly.Block.init (text.js:224)
at new Blockly.Block (block.js:181)
at start (playground.html:147)
at onload (playground.html:429)
Additional Information
Just noticed this when I was writing some unit tests, and thought I should send it in.
Oh I also noticed that colour functions (some of them my own additions) are defined on the block rather than the rendered block, not sure if this is intensional.
The text was updated successfully, but these errors were encountered:
var Blockly = require('node-blockly/browser');
var xml = Blockly.Xml.textToDom(xml_text);
var workspace = new Blockly.Workspace();
Blockly.Xml.domToWorkspace(xml, workspace);
var code = Blockly.JavaScript.workspaceToCode(workspace);
error:
Error: Trying to set block style to procedure_blocks before theme was defined via Blockly.setTheme().
at module.exports.Blockly.Block.setStyle (blockly_compressed_browser.js:1460)
at module.exports.Blockly.Block.init (blocks_compressed_browser.js:106)
at new module.exports.Blockly.Block (blockly_compressed_browser.js:1440)
at module.exports.Blockly.Workspace.newBlock (blockly_compressed_browser.js:1029)
at Object.module.exports.Blockly.Xml.domToBlockHeadless_ (blockly_compressed_browser.js:993)
at Object.module.exports.Blockly.Xml.domToBlock (blockly_compressed_browser.js:990)
at Object.module.exports.Blockly.Xml.domToWorkspace (blockly_compressed_browser.js:986)
Problem statement
Headless workspaces require a theme to be defined, even though they are not rendered.
Expected Behavior
I can create themed blocks on a headless workspace.
Actual Behavior
I recieve an error.
Steps to Reproduce
changeTheme
function of the playground.start
function and replace it with the below:Stack Traces
Additional Information
Just noticed this when I was writing some unit tests, and thought I should send it in.
Oh I also noticed that colour functions (some of them my own additions) are defined on the block rather than the rendered block, not sure if this is intensional.
The text was updated successfully, but these errors were encountered: