blockly-samples icon indicating copy to clipboard operation
blockly-samples copied to clipboard

block-plus-minus plugin: field named "TEXT" not found in "text_join" block

Open johnnyoshika opened this issue 3 years ago • 5 comments

Category

  • Plugins

Component

block-plus-minus

Describe the bug

block-plus-minus plugin, when used with Blockly 8.0.1 and the text_join block results in this warning in the console:

field named "TEXT" not found in "text_join" block (id="|rQF{.!!]-+H=?7ai!O0")

The warning seems to be coming from here: https://github.com/google/blockly/blob/master/blocks/text.js#L682

To Reproduce

  1. Install @blockly/block-plus-minus

  2. Import @blockly/block-plus-minus

import '@blockly/block-plus-minus';
  1. Add text_join block to toolbox:
        {
          kind: 'block',
          type: 'text_join',
        },

Now load Blockly and drag the text_join block into the workspace.

Expected behavior

No warning should appear.

Screenshots

image

Additional context

johnnyoshika avatar May 07 '22 06:05 johnnyoshika

I forgot to list the versions of packages I'm using:

  "dependencies": {
    "@blockly/block-plus-minus": "^3.0.13",
    "@testing-library/jest-dom": "^5.16.4",
    "@testing-library/react": "^13.1.1",
    "@testing-library/user-event": "^13.5.0",
    "@types/jest": "^27.4.1",
    "@types/node": "^16.11.31",
    "@types/react": "^18.0.8",
    "@types/react-dom": "^18.0.0",
    "blockly": "^8.0.1",
    "react": "^18.1.0",
    "react-dom": "^18.1.0",
    "react-scripts": "^4.0.3",
    "typescript": "^4.6.4",
    "web-vitals": "^2.1.4"
  },

johnnyoshika avatar May 07 '22 06:05 johnnyoshika

Thank you for reporting this :D Can reproduce! This doesn't seem to be JSON specific, but happens whenever the block is deserialized (from XML or JSON).

BeksOmega avatar May 09 '22 14:05 BeksOmega

@BeksOmega Given that this is only a warning, is it safe to deploy this to a live production environment?

johnnyoshika avatar May 10 '22 05:05 johnnyoshika

@johnnyoshika yeah it should be fine =)

The issue is that in core, we mix the quoting functionality directly into the text_create_with block, while in the plus/minus plugin we apply the extension. This means that on the plus/minus block we trigger quoting, but in core we do not.

If you look at the quoteField_ definition, it doesn't do anything unless it actually finds a matching field. So the warning just means "hey I didn't do anything".

So I think it should be fine to put in production, but definitely double check my logic for yourself =)

BeksOmega avatar May 10 '22 14:05 BeksOmega

@BeksOmega Awesome, thanks so much for your input!

johnnyoshika avatar May 11 '22 00:05 johnnyoshika