Skip to content

Occur "Maximum update depth exceeded.” in Navigation Screen. #48668

Closed

Description

@torounit

Description

Adding a Custom Link block to the navigation causes "Maximum update depth exceeded.”

This problem does not occur in 15.2.4, it occurs with trunk ( 4945d3f ).

Uncaught Error: Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.
    at checkForNestedUpdates (react-dom.js?ver=18:27302:13)
    at scheduleUpdateOnFiber (react-dom.js?ver=18:25485:5)
    at dispatchSetState (react-dom.js?ver=18:17537:9)
    at assignRef (index.js:20:3)
    at index.js:128:4
    at safelyDetachRef (react-dom.js?ver=18:22918:24)
    at commitDeletionEffectsOnFiber (react-dom.js?ver=18:24013:13)
    at recursivelyTraverseDeletionEffects (react-dom.js?ver=18:23999:7)
    at commitDeletionEffectsOnFiber (react-dom.js?ver=18:24128:11)
    at recursivelyTraverseDeletionEffects (react-dom.js?ver=18:23999:7)

Step-by-step reproduction instructions

  1. Go to Site Editor.
  2. Select Navigation Screen. ( http://localhost:8888/wp-admin/site-editor.php?canvas=view&path=%2Fnavigation )
  3. Insert "Custom Link" Block to Navigation.

Screenshots, screen recording, code snippet

2023-03-02.16.48.57.mov

Environment info

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

Activity

  1. added
    [Type] BugAn existing feature does not function as intended
    on Mar 2, 2023
  2. added
    [Feature] Navigation in Site ViewNavigation section in the Site Editor when in Site View, offering a way to manage Navigation Menus a
    on Mar 2, 2023
  3. Mamaduka commented on Mar 2, 2023

    @Mamaduka
    Member

    I can confirm the bug. This only happens when inserting the "Custom Link" block.

  4. Mamaduka commented on Mar 2, 2023

    @Mamaduka
    Member

    Probably related to #48675.

    cc @getdave, @scruffian

  5. Mamaduka commented on Mar 2, 2023

    @Mamaduka
    Member

    I believe this is the side effect that triggers the update loop.

    useEffect( () => {
    // This side-effect should not create an undo level as those should
    // only be created via user interactions. Mark this change as
    // not persistent to avoid undo level creation.
    // See https://github.com/WordPress/gutenberg/issues/34564.
    __unstableMarkNextChangeAsNotPersistent();
    setAttributes( { isTopLevelLink } );
    }, [ isTopLevelLink ] );

  6. getdave commented on Mar 2, 2023

    @getdave
    Contributor

    That bug is already on the radar and will be fixed by

    #48219

    Thanks for reporting.

  7. moved this from ❓ Triage to 🏗️ In Progress in WordPress 6.2 Editor Taskson Mar 2, 2023
  8. ntsekouras commented on Mar 2, 2023

    @ntsekouras
    Contributor

    This PR seems to have caused this: #47853 and it's not included in 6.2.

  9. Mamaduka commented on Mar 3, 2023

    @Mamaduka
    Member

    @getdave, should we close some of the issues as duplicates?

  10. getdave commented on Mar 3, 2023

    @getdave
    Contributor

    @Mamaduka I've marked this Issue as being closed by #48219. So it will be handled.

  11. moved this from 🏗️ In Progress to ✅ Done in WordPress 6.2 Editor Taskson Mar 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Feature] Navigation in Site ViewNavigation section in the Site Editor when in Site View, offering a way to manage Navigation Menus a[Type] BugAn existing feature does not function as intended

    Type

    No type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions