For each element your block uses, declare both the registry handle and the specific element handle in index.asset.php. WordPress loads these scripts before your block script runs, making element definitions available on window.wptElementDefs before your edit() function executes.
index.asset.php – Correct Dependency Declaration
<?php
return array(
'dependencies' => array(
'wp-blocks',
'wp-element',
'wp-block-editor',
'wp-components',
'wp-i18n',
'wpt-element-registry', // always required if using any element
'wpt-element-heading', // for the heading element
'wpt-element-description', // for the description element
'wpt-element-button', // for the button element
),
'version' => '1.0.0',
);
Only declare the elements your block actually uses. WordPress loads only what is declared, there is no monolithic bundle. A block that only uses a heading and description should not declare wpt-element-button.
Valid element handles follow the pattern wpt-element-{name} where {name} matches the element name in the table above (use the script handle column, note that form-field and pricing-tier use hyphens).
What Happens If an Element Is Not Loaded
If your block calls window.wptElements.buildElementClasses('heading', ...) but wpt-element-heading is not in your index.asset.php dependencies, the registry returns an empty class string and logs this warning to the browser console:
[wpTruss] Element "heading" not found in registry.
Check that wpt-element-heading is declared in index.asset.php.
The block still renders. CSS fallback values in your style.css apply. The block is usable but the site owner cannot customise heading behaviour for that block. This is the most common cause of “element controls not appearing”, always check index.asset.php first.