diff --git a/x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/get_element_position_data.ts b/x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/get_element_position_data.ts index 927cf9ec7d80..ce51dc2317c7 100644 --- a/x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/get_element_position_data.ts +++ b/x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/get_element_position_data.ts @@ -47,5 +47,11 @@ export const getElementPositionAndAttributes = async ( args: [layout.selectors.screenshot, { title: 'data-title', description: 'data-description' }], }); + if (elementsPositionAndAttributes.length === 0) { + throw new Error( + `No shared items containers were found on the page! Reporting requires a container element with the '${layout.selectors.screenshot}' attribute on the page.` + ); + } + return elementsPositionAndAttributes; };