Skip to content

Navigation block erroneously requests /wp/v2/block-navigation-areas in WP 5.9 #37138

@noisysocks

Description

@noisysocks

Description

The Navigation block is making a request to /wp/v2/block-navigation-areas.

const [ areaMenu, setAreaMenu ] = useEntityProp(
'root',
'navigationArea',
'navigation',
navigationArea
);

This won't work when the block is used in WP 5.9 without the Gutenberg plugin active as that REST API endpoint does not exist.

Step-by-step reproduction instructions

  1. Run the latest WP 5.9 trunk with no Gutenberg plugin active.
  2. Open the site editor.
  3. Insert a Navigation block if there isn't already one on the page.
  4. Open DevTools and look in the console.
  5. You'll see a 404 error from a request to /wp/v2/block-navigation-areas.

Screenshots, screen recording, code snippet

No response

Environment info

No response

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions