Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Obtain function inside domToMutation not recognized and giving a "Blockly.Block.obtain is not a function" error #4516

Closed
hiskuDN opened this issue Dec 10, 2020 · 1 comment
Labels
issue: bug Describes why the code or behaviour is wrong

Comments

@hiskuDN
Copy link

hiskuDN commented Dec 10, 2020

Describe the bug

Tried the new version of blockly with zelos renderer and it keeps giving me an error when I'm trying to open the mutators on the default if function

Screenshots

image

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser Chrome latest

Stack Traces

core.js:1673 ERROR TypeError: Blockly.Block.obtain is not a function
    at Blockly.BlockSvg.decompose (blocks_uncompressed.js:461)
    at Blockly.Mutator.setVisible (blockly_uncompressed.js:11856)
    at Blockly.Mutator.Blockly.Icon.iconClick_ (blockly_uncompressed.js:9789)
    at Blockly.Mutator.iconClick_ (blockly_uncompressed.js:11789)
    at SVGGElement.h (blockly_uncompressed.js:9690)
    at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:423)
    at Object.onInvokeTask (core.js:3811)
    at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:422)
    at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:195)
    at ZoneTask.push../node_modules/zone.js/dist/zone.js.ZoneTask.invokeTask [as invoke] (zone.js:498)

Additional context

@hiskuDN hiskuDN added issue: triage Issues awaiting triage by a Blockly team member issue: bug Describes why the code or behaviour is wrong labels Dec 10, 2020
@hiskuDN
Copy link
Author

hiskuDN commented Dec 10, 2020

Oh never mind, I was used Blockly v2 function that was deprecated. Found this on the blockly source code
Blockly.Block.obtain = function(workspace, prototypeName) { console.warn('Deprecated call to Blockly.Block.obtain, ' + 'use workspace.newBlock instead.'); return workspace.newBlock(prototypeName); };

@hiskuDN hiskuDN closed this as completed Dec 10, 2020
@moniika moniika removed the issue: triage Issues awaiting triage by a Blockly team member label Jul 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: bug Describes why the code or behaviour is wrong
Projects
None yet
Development

No branches or pull requests

2 participants