Recently, one of my colleagues made what looked like a harmless change to a Single Directory Component (SDC) used by Drupal Canvas: they simply changed an enum in the component's props schema, then deployed to the dev environment.
The deployment failed during:
drush cimwith:
component entity is a versioned config entity, and its loaded version is not the active versionDrupal Canvas doesn't rely directly on the *.component.yml file at runtime.
For each SDC used by Canvas, it maintains a Component config entity, for example:
canvas.component.sdc.<theme>.<component>This entity keeps:
active_version, based on a hash of the component's props schema;So when you modify a component schema — even something as simple as an enum — the component version changes.
After a cache rebuild, Canvas computes the new version and stores it in the database.
You can then end up with:
*.component.yml → new schema / new hash
config sync → old version
database → new active version💥 And the next drush cim can fail because the configuration and the active Canvas component version no longer match.
Whenever I change the schema of an SDC used by Canvas — props, slots, enums, defaults, etc.:
drush cr
drush cexThen I commit both sides of the change together:
*.component.yml
canvas.component.sdc.*.ymlThe component schema and its Canvas configuration are effectively two halves of the same change.
This also avoids having the generated Canvas version depend on which environment happened to run the last cache rebuild.
Small detail, but an important one when moving Drupal Canvas + SDC changes across environments.