Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
torounit opened this issue Mar 2, 2023 · 7 comments · Fixed by #48219
Closed

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

torounit opened this issue Mar 2, 2023 · 7 comments · Fixed by #48219
Labels
[Feature] Navigation in Site View Navigation section in the Site Editor when in Site View, offering a way to manage Navigation Menus a [Type] Bug An existing feature does not function as intended

Comments

@torounit
Copy link
Member

torounit commented Mar 2, 2023

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

@torounit torounit added the [Type] Bug An existing feature does not function as intended label Mar 2, 2023
@Mamaduka Mamaduka added the [Feature] Navigation in Site View Navigation section in the Site Editor when in Site View, offering a way to manage Navigation Menus a label Mar 2, 2023
@Mamaduka
Copy link
Member

Mamaduka commented Mar 2, 2023

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

@ndiego ndiego moved this to ❓ Triage in WordPress 6.2 Editor Tasks Mar 2, 2023
@Mamaduka
Copy link
Member

Mamaduka commented Mar 2, 2023

Probably related to #48675.

cc @getdave, @scruffian

@Mamaduka
Copy link
Member

Mamaduka commented Mar 2, 2023

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 ] );

@getdave
Copy link
Contributor

getdave commented Mar 2, 2023

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

#48219

Thanks for reporting.

@ndiego ndiego linked a pull request Mar 2, 2023 that will close this issue
@ndiego ndiego moved this from ❓ Triage to 🏗️ In Progress in WordPress 6.2 Editor Tasks Mar 2, 2023
@ntsekouras
Copy link
Contributor

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

@Mamaduka
Copy link
Member

Mamaduka commented Mar 3, 2023

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

@getdave
Copy link
Contributor

getdave commented Mar 3, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Navigation in Site View Navigation section in the Site Editor when in Site View, offering a way to manage Navigation Menus a [Type] Bug An existing feature does not function as intended
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

4 participants