Opened 3 days ago
Closed 2 days ago
#65450 closed defect (bug) (reported-upstream)
Site Editor crashes on block style variation detail route for `core/column`
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 7.0 |
| Component: | Editor | Keywords: | |
| Focuses: | Cc: |
Description
When opening the Site Editor style variation detail screen for a core/column block style variation, the editor crashes with:
`text
TypeError: Cannot read properties of undefined (reading 'map')
`
This reproduces with the default Twenty Twenty-Five theme, so it does not appear to be caused by a custom theme implementation.
Environment
- WordPress: 7.0
- Theme: Twenty Twenty-Five 1.5
- Browser: Chromium-based browser
- Context: Site Editor → Styles → Blocks → Column → Style variation
Steps To Reproduce
- Activate Twenty Twenty-Five 1.5.
- Open the Site Editor.
- Navigate to a
core/columnblock style variation detail route, for example:
`text
/wp-admin/site-editor.php?p=%2Fstyles§ion=%2Fblocks%2Fcore%252Fcolumn%2Fvariations%2Fsection-1
`
- Observe the JavaScript error.
Actual Result
The Site Editor crashes and logs:
`text
TypeError: Cannot read properties of undefined (reading 'map')
at Dwe (.../wp-includes/js/dist/editor.min.js:149:7185)
`
Expected Result
The style variation detail screen should render without crashing.
If the Style Book has no standalone preview example for core/column, the editor should either:
- fall back to a suitable parent/container example, or
- render an empty/unsupported preview state gracefully, without throwing.
Technical Notes
The error appears to come from the Style Book preview flow.
In the unminified editor build, applyBlockVariationsToExamples() assumes examples is defined:
`js
function applyBlockVariationsToExamples(examples, variation) {
if (!variation) {
return examples;
}
return examples.map((example) => {
...
});
}
`
For core/column variation routes, the filtered Style Book example set appears to be missing or undefined, likely because core/column is primarily a nested child block and does not have a standalone Style Book example.
The same route pattern works for core/group, but fails for core/column.
Additional Reproduction
A custom block style variation for core/column produces the same error, while the same variation on core/group renders normally. This suggests the issue is tied to core/column Style Book preview handling rather than a specific theme JSON style declaration.
Change History (3)
#2
@
2 days ago
I have tested this issue in Gutenberg and can confirm it is reproducible there as well. Since the source of this bug is in the Gutenberg repository, I have opened a corresponding issue on GitHub to track the fix: https://github.com/WordPress/gutenberg/issues/79130
Reproduction Report
Environment
Steps taken
Expected behavior
The style variation detail screen should render without crashing the editor.
Screenshots/Screencast with results