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

Navigation block: JS error when the block is placed inside a template part #52680

Closed
carolinan opened this issue Jul 17, 2023 · 3 comments
Closed
Labels
[Block] Navigation Affects the Navigation Block [Type] Bug An existing feature does not function as intended

Comments

@carolinan
Copy link
Contributor

carolinan commented Jul 17, 2023

Description

I am only able to reproduce this with Wp 6.3. current nightly and Gutenberg current trunk.
I have not tested in other themes than Twenty Twenty-Three.

In the Site editor,
When adding a navigation block inside a template part, and hovering over the Navigation menu in the block settings sidebar: (The three dots next to the text "Menu" in the first tab of the block settings),
I see this JS error in the console:

react-dom.min.js?ver=18:1 Error: Minified React error #31; visit https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=object%20with%20keys%20%7Brendered%7D for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
at ct (react-dom.min.js?ver=18:1:41145)
at p (react-dom.min.js?ver=18:1:42914)
at g (react-dom.min.js?ver=18:1:44061)
at e (react-dom.min.js?ver=18:1:46125)
at dr (react-dom.min.js?ver=18:1:54774)
at $s (react-dom.min.js?ver=18:1:122387)
at Sl (react-dom.min.js?ver=18:1:88649)
at kl (react-dom.min.js?ver=18:1:88577)
at bl (react-dom.min.js?ver=18:1:88440)
at sl (react-dom.min.js?ver=18:1:85264)

Objects are not valid as a React child (found: object with keys {rendered}). If you meant to render a collection of children, use an array instead.

Step-by-step reproduction instructions

In the site editor, select an existing template part or create a new.
Add a navigation block as a direct child. It has to be a direct child: if you place the navigation block inside a group block first, the JS error does not appear. If you wrap the navigation block after placement, the JS error dissapears.

With the navigation block selected, hover over the first ellipsis menu in the first tab of the block settings sidebar, and see the JS error.

Screenshots, screen recording, code snippet

js-error.mp4

Environment info

Active plugin: Beta tester. Gutenberg current trunk

WP 6.3-beta4-56243
nginx
PHP 8.1.9., 8.0.2 (tested on two different installations, with and without demo content)
Mac OS 13.4.1
Chrome 114.0.5735.198

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

No

@carolinan carolinan added [Type] Bug An existing feature does not function as intended [Block] Navigation Affects the Navigation Block labels Jul 17, 2023
@Mamaduka
Copy link
Member

@carolinan, can you re-test this when using Gutenberg dev build - npm run dev? It should give us a clear error message and stack trace.

@carolinan
Copy link
Contributor Author

hmm, it still gives me

react-dom.min.js?ver=18:121 Error: Minified React error #31; visit https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=object%20with%20keys%20%7Brendered%7D for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
    at vd (react-dom.min.js?ver=18:96:347)
    at u (react-dom.min.js?ver=18:100:158)
    at x (react-dom.min.js?ver=18:102:301)
    at w (react-dom.min.js?ver=18:106:334)
    at aa (react-dom.min.js?ver=18:123:401)
    at Rk (react-dom.min.js?ver=18:253:416)
    at Si (react-dom.min.js?ver=18:195:185)
    at Pk (react-dom.min.js?ver=18:195:116)
    at Nd (react-dom.min.js?ver=18:194:492)
    at Qf (react-dom.min.js?ver=18:187:439)
wf @ react-dom.min.js?ver=18:121
f.componentDidCatch.c.callback @ react-dom.min.js?ver=18:122
Fh @ react-dom.min.js?ver=18:92
Ki @ react-dom.min.js?ver=18:180
Ii @ react-dom.min.js?ver=18:179
Ik @ react-dom.min.js?ver=18:178
Sk @ react-dom.min.js?ver=18:197
yb @ react-dom.min.js?ver=18:196
Oi @ react-dom.min.js?ver=18:186
S @ react.min.js?ver=18:17
U @ react.min.js?ver=18:21

@carolinan
Copy link
Contributor Author

Duplicate of #52691

@carolinan carolinan marked this as a duplicate of #52691 Jul 19, 2023
@carolinan carolinan closed this as not planned Won't fix, can't repro, duplicate, stale Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Navigation Affects the Navigation Block [Type] Bug An existing feature does not function as intended
Projects
Development

No branches or pull requests

2 participants