Error when adding sublayout to item presentation settings using Experience Editor


Description

When adding a sublayout to the presentation setting for an item via Experience Editor, the following errors may occur:

  1. "An error occurred" popup message appears.
  2. A JavaScript error is shown in the browser console:
    Could not find the rendering in the HTML loaded from server

The issue occurs when trying to add a sublayout right after another sublayout or rendering that does not have a placeholder specified in the presentation details.

Solution

To address the issue, apply one of the solutions below: