You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am developing a new header template part. I made a mistake in my code of one of my custom blocks, but now my admin page cannot reset the header template part to continue dev because that page crashes.
I understand there is an issue with my code, but I'm not reporting the crash in the block itself, but the inability for me to reset the template part after the code breaks. Please see my GIF below.
Ideally, if the template part crashes, the menu should show the same error as the edit-page section in the preview window, and allow me to reset the template part back to the file state (remove customisations).
In case it is needed, the issue with my code was in the save component of my block. I had an attribute that was not set and I was trying to use startsWith on the undefined attribute.
Step-by-step reproduction instructions
Create a header template part.
Select that template part as the active template (potentially make changes to save it to the database).
Force an error in that template part by breaking a block that is contained in the template part. This may be any error but also may only be an error in the Save component of a static block.
Try and access the template part via the site-editor.
Screenshots, screen recording, code snippet
Description of GIF recording:
I can see my template part has an issue if I view in the site editor via a page edit screen, it show the message (and I also highlight that it is indeed the header template part)
Then I go to the Patterns menu and show that those work fine
Then when I click the "header" template part section, that section of the site crashes and just shows a black screen.
Then, even when I try and go back via the browser, it stays crashed. The only way to fix it is by hitting enter with the url selected to force the page to reload completely.
Environment info
Wordpress 6.5
Gutenberg not installed
No other plugins installed.
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
The text was updated successfully, but these errors were encountered:
Description
I am developing a new header template part. I made a mistake in my code of one of my custom blocks, but now my admin page cannot reset the header template part to continue dev because that page crashes.
I understand there is an issue with my code, but I'm not reporting the crash in the block itself, but the inability for me to reset the template part after the code breaks. Please see my GIF below.
Ideally, if the template part crashes, the menu should show the same error as the edit-page section in the preview window, and allow me to reset the template part back to the file state (remove customisations).
In case it is needed, the issue with my code was in the save component of my block. I had an attribute that was not set and I was trying to use startsWith on the undefined attribute.
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
Description of GIF recording:
I can see my template part has an issue if I view in the site editor via a page edit screen, it show the message (and I also highlight that it is indeed the header template part)
Then I go to the Patterns menu and show that those work fine
Then when I click the "header" template part section, that section of the site crashes and just shows a black screen.
Then, even when I try and go back via the browser, it stays crashed. The only way to fix it is by hitting enter with the url selected to force the page to reload completely.
Environment info
Wordpress 6.5
Gutenberg not installed
No other plugins installed.
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
The text was updated successfully, but these errors were encountered: