{"componentChunkName":"component---src-templates-post-jsx","path":"/en/drupal-canvas-sdc-export-config","result":{"data":{"markdownRemark":{"html":"<p>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 <code class=\"language-text\">enum</code> in the component's props schema, then deployed to the dev environment.</p>\n<p>The deployment failed during:</p>\n<div class=\"gatsby-highlight\" data-language=\"bash\"><pre class=\"language-bash\"><code class=\"language-bash\">drush cim</code></pre></div>\n<p>with:</p>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">component entity is a versioned config entity, and its loaded version is not the active version</code></pre></div>\n<h2>🔍 What happened?</h2>\n<p>Drupal Canvas doesn't rely directly on the <code class=\"language-text\">*.component.yml</code> file at runtime.</p>\n<p>For each SDC used by Canvas, it maintains a <code class=\"language-text\">Component</code> config entity, for example:</p>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">canvas.component.sdc.&lt;theme&gt;.&lt;component&gt;</code></pre></div>\n<p>This entity keeps:</p>\n<ul>\n<li>an <code class=\"language-text\">active_version</code>, based on a hash of the component's props schema;</li>\n<li>a history of previous versions, so existing Canvas component instances can continue to work.</li>\n</ul>\n<p>So when you modify a component schema — even something as simple as an <code class=\"language-text\">enum</code> — the component version changes.</p>\n<p>After a cache rebuild, Canvas computes the new version and stores it in the database.</p>\n<p>You can then end up with:</p>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">*.component.yml  →  new schema / new hash\nconfig sync      →  old version\ndatabase         →  new active version</code></pre></div>\n<p>💥 And the next <code class=\"language-text\">drush cim</code> can fail because the configuration and the active Canvas component version no longer match.</p>\n<h2>✅ The rule I now follow</h2>\n<p>Whenever I change the schema of an SDC used by Canvas — props, slots, enums, defaults, etc.:</p>\n<div class=\"gatsby-highlight\" data-language=\"bash\"><pre class=\"language-bash\"><code class=\"language-bash\">drush cr\ndrush cex</code></pre></div>\n<p>Then I commit both sides of the change together:</p>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">*.component.yml\ncanvas.component.sdc.*.yml</code></pre></div>\n<p>The component schema and its Canvas configuration are effectively two halves of the same change.</p>\n<p>This also avoids having the generated Canvas version depend on which environment happened to run the last cache rebuild.</p>\n<p>Small detail, but an important one when moving Drupal Canvas + SDC changes across environments.</p>","excerpt":"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  in…","frontmatter":{"date":"2026-09-24","metaDate":"2026-09-24","title":"Drupal Canvas: changed a component's props? Export your config","tags":["Drupal","Drupal Canvas","SDC","Configuration","Drush","DevOps"],"path":"/drupal-canvas-sdc-export-config","cover":{"childImageSharp":{"fluid":{"base64":"data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAALABQDASIAAhEBAxEB/8QAFwABAQEBAAAAAAAAAAAAAAAAAAIBBf/EABYBAQEBAAAAAAAAAAAAAAAAAAADBP/aAAwDAQACEAMQAAAB5dw2zwH/xAAXEAADAQAAAAAAAAAAAAAAAAAAAREg/9oACAEBAAEFAkTP/8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAwEBPwE//8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAgEBPwE//8QAFBABAAAAAAAAAAAAAAAAAAAAIP/aAAgBAQAGPwJf/8QAFxAAAwEAAAAAAAAAAAAAAAAAAAERIP/aAAgBAQABPyFKNJn/2gAMAwEAAgADAAAAEJPf/8QAFhEAAwAAAAAAAAAAAAAAAAAAARAx/9oACAEDAQE/EDV//8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAgEBPxA//8QAGBABAAMBAAAAAAAAAAAAAAAAARARQQD/2gAIAQEAAT8QNNtV2hKrsf/Z","aspectRatio":1.7777777777777777,"src":"/static/e9b668058154a4d1533f6174475064af/88110/cover.jpg","srcSet":"/static/e9b668058154a4d1533f6174475064af/0b320/cover.jpg 480w,\n/static/e9b668058154a4d1533f6174475064af/60b32/cover.jpg 960w,\n/static/e9b668058154a4d1533f6174475064af/88110/cover.jpg 1920w,\n/static/e9b668058154a4d1533f6174475064af/c33c1/cover.jpg 2560w","srcWebp":"/static/e9b668058154a4d1533f6174475064af/d1a9d/cover.webp","srcSetWebp":"/static/e9b668058154a4d1533f6174475064af/bc3bf/cover.webp 480w,\n/static/e9b668058154a4d1533f6174475064af/39337/cover.webp 960w,\n/static/e9b668058154a4d1533f6174475064af/d1a9d/cover.webp 1920w,\n/static/e9b668058154a4d1533f6174475064af/ca60f/cover.webp 2560w","sizes":"(max-width: 1920px) 100vw, 1920px"},"resize":{"src":"/static/e9b668058154a4d1533f6174475064af/c4f3a/cover.jpg"}}}}}},"pageContext":{"isCreatedByStatefulCreatePages":false,"pathSlug":"/drupal-canvas-sdc-export-config","locale":"en","prev":{"fields":{"locale":"en"},"frontmatter":{"path":"/drupal-12-alpha1-release","title":"Drupal 12.0.0-alpha1: the countdown has started","tags":["Drupal","Drupal 12","Drupal 11","Drupal 10","PHP","Symfony","Update","News"]}},"next":null}}}