Summary
Opening the Posts block Elements panel can break the block editor with TypeError: window.themeisleGutenberg.imageSizes.map is not a function.
Expected behavior: the Elements panel opens and allows changing Posts block element settings, including image-related settings.
Actual behavior: the block enters the editor recovery state when the panel is opened. Switching to Code Editor and back to Visual Editor temporarily recovers the block, but opening Elements triggers the failure again.
Impact: affected users cannot change the Posts block element settings for pages where this editor data shape is present.
Customer context
- Product / area: Otter Blocks, Posts block editor inspector,
Elements panel
- Version: Customer-installed version not provided. Repository inspected at Otter Blocks
3.1.11.
- Environment: WordPress block editor; console stack includes React DOM
18.3.1.1 from WordPress core assets.
- Integration / third party: Unknown from available evidence.
- Reported error / symptom:
TypeError: window.themeisleGutenberg.imageSizes.map is not a function
- Impact: The Posts block breaks when opening
Elements; editor mode switching recovers the block temporarily but the settings remain inaccessible.
Reproduction notes
Reported steps:
- Edit a page containing an Otter Posts block.
- Open the Posts block settings sidebar.
- Click
Elements.
- The block breaks and the console shows
TypeError: window.themeisleGutenberg.imageSizes.map is not a function.
- Switching to Code Editor and back to Visual Editor recovers the block temporarily, but opening
Elements repeats the failure.
Reproduction status: not reproduced locally at runtime. Source inspection confirms the reported failing expression is reachable from the Posts block Elements panel. Missing details: installed Otter version, active theme/plugins, custom image-size registrations, and the actual runtime value of themeisleGutenberg.imageSizes.
Diagnosis
Conclusion
The report is consistent with a product-side editor crash in the Otter Posts block. Fact: the ticket’s console error names window.themeisleGutenberg.imageSizes.map, and the Posts block image element settings call .map() on that global value. Fact: Otter localizes imageSizes from PHP into the editor global. Inference: on the reported site, that localized value is present but not a JavaScript array, so opening Elements reaches the image settings control and crashes rendering. Runtime reproduction was not performed.
Where this likely occurs
- User-visible surface: Posts block editor sidebar,
Elements panel, image element settings.
src/blocks/blocks/posts/inspector.js — Inspector() lines 344–351 renders the Elements panel and passes attributes into LayoutBuilder.
src/blocks/blocks/posts/components/design-layout-builder.js — LayoutBuilder() lines 54–75 renders the image SortableItem before the sortable element list, making the image settings path reachable from the panel.
src/blocks/blocks/posts/components/sortable.js — SortableItem() lines 155–172 renders the Image Size SelectControl and calls window.themeisleGutenberg.imageSizes.map(...) directly.
inc/class-registration.php — Registration editor asset localization path lines 250–268 sets themeisleGutenberg.imageSizes from get_intermediate_image_sizes() or a WPVIP fallback array.
- Related surface:
src/blocks/blocks/review/inspector.js — review block inspector lines 348–355 also consumes window.themeisleGutenberg.imageSizes.map(...); no report was provided for this block.
- Git history:
git blame shows the imageSizes localization at inc/class-registration.php line 267 traces to commit 59a3c72f6 from 2022-06-28. The Posts image-ratio/settings history includes 837b6e92 (feat: add image ratio setting to Posts Block), which touches the inspected Posts settings area but does not by itself prove a recent regression.
Engineering notes
- The code path assumes
themeisleGutenberg.imageSizes is a JavaScript array. The TypeScript declaration in src/blocks/global.d.ts line 64 also models it as string[].
- The PHP localization source is a WordPress image-size list for normal installs and a hardcoded list for WPVIP-detected installs. The WPVIP branch is an indexed array in the inspected code.
- The ticket error implies the global object exists, but
imageSizes does not have Array .map(). This suggests a shape mismatch rather than a missing script/global.
- WordPress core source was not present in the inspected workspace, so behavior of
get_intermediate_image_sizes() and its filters is treated as an external dependency assumption. A filtered or non-list PHP array is a plausible source of JavaScript object encoding, but that was not verified from local core source.
- No evidence in the thread identifies the active theme, active plugins, registered custom image sizes, or filters affecting image sizes.
Test coverage status
tests/test-post-grid-block.php covers server-side Posts grid rendering and attributes, including imageSize, but not the editor inspector Elements panel or localized editor data shape.
- No
SortableItem, LayoutBuilder, imageSizes, or Posts block editor e2e coverage was found under src/blocks/test during inspection.
- No relevant coverage was found during inspection for a non-array
themeisleGutenberg.imageSizes value in the editor.
What to verify or explore next
- May be worth reproducing in a local editor session by making the localized
themeisleGutenberg.imageSizes value a non-array object and opening Posts block Elements.
- May be worth verifying whether custom image sizes or filters on
intermediate_image_sizes can make the localized PHP array encode as a JavaScript object in supported WordPress versions.
- If reproducible, checking the Review block image settings may clarify whether the same global-data shape affects more than the Posts block.
- Relevant suites to consider for verification: Posts block editor/e2e coverage under
src/blocks/test/e2e if added or extended; PHP rendering tests do not exercise this editor path.
Unknowns / follow-up
- Customer-installed Otter version is not present in the transcript.
- Active plugins, theme, custom image size registrations, and image-size filters are unknown from available evidence.
- The exact serialized value of
window.themeisleGutenberg.imageSizes on the affected site is unknown.
Confidence
Confidence: 83/100
The reported console error matches an unguarded product editor code path in Otter Blocks’ Posts block, and repository inspection shows the failing value is consumed as an array without runtime validation.
Source: HelpScout #3363681795
Generated by bug-report-triage (ID: bug-report-triage_6a3994590c70e7.35132840)
Summary
Opening the Posts block
Elementspanel can break the block editor withTypeError: window.themeisleGutenberg.imageSizes.map is not a function.Expected behavior: the
Elementspanel opens and allows changing Posts block element settings, including image-related settings.Actual behavior: the block enters the editor recovery state when the panel is opened. Switching to Code Editor and back to Visual Editor temporarily recovers the block, but opening
Elementstriggers the failure again.Impact: affected users cannot change the Posts block element settings for pages where this editor data shape is present.
Customer context
Elementspanel3.1.11.18.3.1.1from WordPress core assets.TypeError: window.themeisleGutenberg.imageSizes.map is not a functionElements; editor mode switching recovers the block temporarily but the settings remain inaccessible.Reproduction notes
Reported steps:
Elements.TypeError: window.themeisleGutenberg.imageSizes.map is not a function.Elementsrepeats the failure.Reproduction status: not reproduced locally at runtime. Source inspection confirms the reported failing expression is reachable from the Posts block
Elementspanel. Missing details: installed Otter version, active theme/plugins, custom image-size registrations, and the actual runtime value ofthemeisleGutenberg.imageSizes.Diagnosis
Conclusion
The report is consistent with a product-side editor crash in the Otter Posts block. Fact: the ticket’s console error names
window.themeisleGutenberg.imageSizes.map, and the Posts block image element settings call.map()on that global value. Fact: Otter localizesimageSizesfrom PHP into the editor global. Inference: on the reported site, that localized value is present but not a JavaScript array, so openingElementsreaches the image settings control and crashes rendering. Runtime reproduction was not performed.Where this likely occurs
Elementspanel, image element settings.src/blocks/blocks/posts/inspector.js—Inspector()lines 344–351 renders theElementspanel and passes attributes intoLayoutBuilder.src/blocks/blocks/posts/components/design-layout-builder.js—LayoutBuilder()lines 54–75 renders the imageSortableItembefore the sortable element list, making the image settings path reachable from the panel.src/blocks/blocks/posts/components/sortable.js—SortableItem()lines 155–172 renders theImage SizeSelectControland callswindow.themeisleGutenberg.imageSizes.map(...)directly.inc/class-registration.php—Registrationeditor asset localization path lines 250–268 setsthemeisleGutenberg.imageSizesfromget_intermediate_image_sizes()or a WPVIP fallback array.src/blocks/blocks/review/inspector.js— review block inspector lines 348–355 also consumeswindow.themeisleGutenberg.imageSizes.map(...); no report was provided for this block.git blameshows theimageSizeslocalization atinc/class-registration.phpline 267 traces to commit59a3c72f6from 2022-06-28. The Posts image-ratio/settings history includes837b6e92(feat: add image ratio setting to Posts Block), which touches the inspected Posts settings area but does not by itself prove a recent regression.Engineering notes
themeisleGutenberg.imageSizesis a JavaScript array. The TypeScript declaration insrc/blocks/global.d.tsline 64 also models it asstring[].imageSizesdoes not have Array.map(). This suggests a shape mismatch rather than a missing script/global.get_intermediate_image_sizes()and its filters is treated as an external dependency assumption. A filtered or non-list PHP array is a plausible source of JavaScript object encoding, but that was not verified from local core source.Test coverage status
tests/test-post-grid-block.phpcovers server-side Posts grid rendering and attributes, includingimageSize, but not the editor inspectorElementspanel or localized editor data shape.SortableItem,LayoutBuilder,imageSizes, or Posts block editor e2e coverage was found undersrc/blocks/testduring inspection.themeisleGutenberg.imageSizesvalue in the editor.What to verify or explore next
themeisleGutenberg.imageSizesvalue a non-array object and opening Posts blockElements.intermediate_image_sizescan make the localized PHP array encode as a JavaScript object in supported WordPress versions.src/blocks/test/e2eif added or extended; PHP rendering tests do not exercise this editor path.Unknowns / follow-up
window.themeisleGutenberg.imageSizeson the affected site is unknown.Confidence
Confidence: 83/100
The reported console error matches an unguarded product editor code path in Otter Blocks’ Posts block, and repository inspection shows the failing value is consumed as an array without runtime validation.
Source: HelpScout #3363681795
Generated by bug-report-triage (ID: bug-report-triage_6a3994590c70e7.35132840)