Skip to content

Editor crash with block using supports.color and no attributes #73135

@kmanijak

Description

@kmanijak

Description

Editor crashes (blank page) with the error of:

color.js:100 Uncaught TypeError: Cannot read properties of undefined (reading 'backgroundColor')
    at h0e (color.js:100:29)
    at h (createRunHook.ts:84:32)
    at createRunHook.ts:96:34
    at process-block-type.js:106:20
    at thunk-middleware.js:4:11
    at index.ts:34:12
    at promise-middleware.js:20:9
    at Object.dispatch (resolvers-cache-middleware.js:45:10)
    at Proxy.get (index.js:256:25)
    at private-actions.js:34:30

if you register a block with block.json that has:

  • no attributes definition - it's not required
  • but uses supports.color field

Started happening on night from Nov 7-8 (caught by WooCommerce daily checks with GB nightly)

Step-by-step reproduction instructions

  1. Make sure some of your blocks in block.json
    • has no attributes
    • uses supports.color
  2. Create new post
  3. See blank page and console error
  4. Either removing supports.color or adding attributes: {} results in editor loading fine

Screenshots, screen recording, code snippet

Image

Environment info

GB trunk

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Feature] Block APIAPI that allows to express the block paradigm.[Type] BugAn existing feature does not function as intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions