Skip to content

Uncaught TypeError when adding new blocks to the Navigation Core Block in Wordpress #67712

@darnado

Description

@darnado

Description

An "Uncaught TypeError" appears in the console when adding a block to the Navigation Core Block via the sidebar. Despite the error, the block is successfully added.

Expected Result:

  • The block should be added without any console errors.

Actual Result:

  • In Google Chrome the following console error appears: ''Uncaught TypeError: Cannot read properties of null (reading 'contains')''.
  • In Firefox the console error is slightly different: ''Uncaught TypeError: P.current is null''.
  • The block is added successfully despite the error.

Step-by-step reproduction instructions

  1. Go to Appearance → Editor in the WordPress Dashboard.
  2. Open the Design section.
  3. Navigate to Patterns → Header, and select any pattern containing the Navigation Core Block.
  4. Select the Navigation Core Block and click the "plus" button.
  5. Click "+ Add block," then select "Browse All" to open the sidebar with available blocks.
  6. Click on any block in the sidebar to add it to the Navigation Core Block.

Screenshots, screen recording, code snippet

  • Screenshot of the error in Google Chrome console.

Image

  • Screenshot of the error in Firefox console.

Image

  • Gif showcasing the error in Firefox.

Image

Environment info

  • WordPress 6.7.1.
  • Gutenberg versions: 18.6-19.3 (according to the canonical list available in this link: Versions in Wordpress)
  • Default WordPress installation.
  • Twenty Twenty-Five theme.
  • Issue reproduced on both Google Chrome and Firefox.
  • PHP version: 8.2.23

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

Labels

[Block] Navigation LinkAffects the Navigation Link Block[Status] In ProgressTracking issues with work in progress[Type] BugAn existing feature does not function as intended

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions