google / blockly

The web-based visual programming editor.
https://developers.google.com/blockly/
Apache License 2.0
12.5k stars 3.72k forks source link

blockly developer tools block display is broken #6820

Closed rylid-umil closed 1 month ago

rylid-umil commented 1 year ago

Check for duplicates

Description

when ever i load a block from block library on firefox, the preview does not show no matter what. its supposed to be there. when i create a new block however, it works fine. all other block displays work.

Reproduction steps

  1. have blocks in the block library
  2. load one
  3. look at the preview

Stack trace

No response

Screenshots

image

Browsers

Firefox desktop

mrkprdo commented 1 year ago

It could be that you have conflicting "names" in the editor workspace. If you see something like blue triangles next to the name, you should change that to something else.

rylid-umil commented 1 year ago

i dont have any conflicting names and it still doesnt show

Njinx commented 1 year ago

@rylid-umil Do you see this message on the left pane? 2023-02-09_15-17

lkarthee commented 1 year ago

I have encountered same issue and it makes the dev workspace unusable.

All the blocks in workspace are not rendered in preview with the same error:

You can't make a block called <BlockName> in this tool because that name already exists. 4 factory.js:193:15
    warnExistingBlock factory.js:193
    updatePreview factory.js:205
    updateLanguage factory.js:148
    fireChangeListener workspace.ts:686
    fireNow$$module$build$src$core$events$utils utils.ts:249
    (Async: setTimeout handler)
    utils utils.ts:227
    (Async: FrameRequestCallback)
    fireInternal$$module$build$src$core$events$utils utils.ts:226
    fire$$module$build$src$core$events$utils utils.ts:211
    dispose block.ts:325
    dispose block_svg.ts:854
    clear workspace.ts:357
    clear workspace_svg.ts:2356
    openBlock block_library_controller.js:68
    setSelectedAndOpen_ block_library_controller.js:253
    makeOptionSelectHandler_ block_library_controller.js:271
    (Async: EventListener.handleEvent)
    addEventListener eval:4
    addOptionSelectHandler block_library_controller.js:278
    addOptionSelectHandlers block_library_controller.js:289
    populateBlockLibrary block_library_controller.js:165
    AppController app_controller.js:22
    init index.html:40
    (Async: EventListener.handleEvent)
    addEventListener eval:4
    <anonymous> index.html:44

I have checked local storage in the browser - it has no duplicate blocks. image

Any Idea why this is happening ?

993499094 commented 1 year ago

I had the same problem. Alt

Reproduction steps

Blockly > Demos > Blockly Developer Tools https://blockly-demo.appspot.com/static/demos/blockfactory/index.html Workspace Save Share Link https://blockly-demo.appspot.com/static/demos/blockfactory/index.html#debreq

Change the default name [block_type] to name [block_test]

Click on "Block Library" and select "block_test".

Console error: You can't make a block called block_test in this tool because that name already exists. warnExistingBlock @ factory.js:

In summary: even if you select a saved block from the "Block Library", the program considers it to be a duplicate of the "NAME". The preview cannot be displayed.

NeilFraser commented 1 year ago

Another external report: https://groups.google.com/g/blockly/c/AIC5qvOXAn4

alicialics commented 1 year ago

@NeilFraser caused by Exporter importing these blocks: https://github.com/google/blockly/blob/7d2c307fedbcb2cbb5f40382e69b912109c86666/demos/blockfactory/block_exporter_controller.js#L31

https://github.com/google/blockly/blob/7d2c307fedbcb2cbb5f40382e69b912109c86666/demos/blockfactory/block_exporter_tools.js#L187

Apro123 commented 10 months ago

A quick workaround is to rename the block to show the preview, then rename it back when done editing/viewing before clicking "Update" (if necessary)

lancefisher commented 8 months ago

Another workaround is to clear local storage, then re-import your block library.

cpcallen commented 4 months ago

Marking this as triage again because it appears to be preventing people from updating to the new block factory.

cpcallen commented 3 months ago

I think this may be a duplicate of (or at least related to) #5570.

tashee commented 2 months ago

Seems to be called from updateLanguage which marks the Blocklyblock as already created in Firefox but not in Chrome