500 error for code component preview after deleting required prop from in-use Code Component
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3574743. --> Reported by: [mayur-sose](https://www.drupal.org/user/3832406) Related to !650 !635 >>> <h3 id="overview">Overview</h3> <p>There is an error in the Code Component editor when a required property is deleted from a component that is already in use on existing pages. </p> <p>Furthermore, while the UI allows the user to publish these changes despite the console error, it leaves the site in a broken state. When attempting to edit any page containing an instance of that component, the right-hand sidebar fails to render with the error: <code>An unexpected error has occurred while rendering the component's form.</code></p> <h4>Error Details</h4> <ul> <li><strong>Console Error on Save:</strong> <code>status: '500', message: '[canvas:code1/text] The property text is required.'</code></li> <li><strong>Form Rendering Error:</strong> <code>Cannot read properties of undefined (reading 'resolve')</code></li> </ul> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <ol> <li>Create a Code Component with a <strong>required</strong> prop (e.g., a "text" prop).</li> <li>Add this component to one or more pages and publish them.</li> <li>Go back to the Code Component editor and <strong>delete</strong> the required prop.</li> <li>Click <strong>Save</strong>. Observe the 500 Error in the browser console.</li> <li>Click <strong>Publish</strong>. The changes are published despite the previous error.</li> <li>Open a page that uses this component in the Canvas editor.</li> <li>Click on the component instance.</li> <li><strong>Result:</strong> The right-hand sidebar (component form) fails to load, displaying an "unexpected error" message.</li> </ol> <h3 id="proposed-resolution">Proposed resolution</h3> <h3 id="ui-changes">User interface changes</h3> > Related issue: [Issue #3568906](https://www.drupal.org/node/3568906) > Related issue: [Issue #3539147](https://www.drupal.org/node/3539147) > Related issue: [Issue #3520449](https://www.drupal.org/node/3520449)
issue