[1.x] InvalidComponentException when slots contain examples property

Created on 14 July 2025, about 18 hours ago

Problem/Motivation

The Component Validator throws InvalidComponentException when slots contain content examples, preventing components from loading properl
Error:
Drupal\Core\Render\Component\Exception\InvalidComponentException: [slots.media.examples[0]] Object value found, but a string is required in Drupal\Core\Theme\Component\ComponentValidator->validateDefinition() (line 144 of core/lib/Drupal/Core/Theme/Component/ComponentValidator.php).

Proposed resolution

Remove examples from slot definitions in component YAML files. Slots should only contain title and description properties.

🐛 Bug report
Status

Active

Version

1.3

Component

Code

Created by

🇪🇸Spain Iván Barrios

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024