Under the documentation for the Builder web component, there is the following code example
element.addEventListener('load', event => {
var data = event.detail.data
if (!data) {
// No matching content was found
show404()
} else {
animateIn()
}
})
When I implement this, however, and I want to show a “page not found” page, event.detail
is coming back as null
, and therefore event.detail.data
will produce a console error.