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
- Go to Appearance → Editor in the WordPress Dashboard.
- Open the Design section.
- Navigate to Patterns → Header, and select any pattern containing the Navigation Core Block.
- Select the Navigation Core Block and click the "plus" button.
- Click "+ Add block," then select "Browse All" to open the sidebar with available blocks.
- 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.

- Screenshot of the error in Firefox console.

- Gif showcasing the error in Firefox.

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.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Please confirm which theme type you used for testing.
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:
Actual Result:
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
Environment info
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Please confirm which theme type you used for testing.