Skip to content

Loading Blockly as ES6 module creates a global object #4364

@seldomU

Description

@seldomU

Describe the bug

Importing Blockly as a module should add a Blockly object to the scope of the script that imports it. But there is a second Blockly object created that gets added to the global window object. It contains Msg entries.

To Reproduce

Run the the webpack example server, load the index page, use the debugger to pause the page and inspect the scopes. In Chrome I could only see the global scope, Firefox shows more.

Expected behavior

There should only be one Blockly object. I stumbled over this because my unusual block loading method resulted in blockdefinitions being devided between the two Blockly objects. JavaScript definitions landed in one, JSON definitions in the other.

Desktop (please complete the following information):

  • OS: windows 10
  • Browser: Chrome 85 & Firefox 81

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue: bugDescribes why the code or behaviour is wrong

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions