UI shows error 'can't access property "resolved", ne[r] is undefined' with extjs-components having no props
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3559574. --> Reported by: [fago](https://www.drupal.org/user/16747) Related to !357 !347 !355 >>> <h3 id="overview">Problem</h3> <p>When working with extjs-component based components, every component without props reproducible leads to an error being shown in the settings form, when the component is activated for editing in the UI. In this case, no API request to fetch the input-form is made and the UI tries to re-render the settings form <strong>with the form of the previously-edited-component</strong>, and errors out.</p> <p>Error:<br> <img src="https://www.drupal.org/files/issues/2025-11-24/Bildschirmfoto%20vom%202025-11-24%2012-22-47.png" alt="Error"></p> <p>Error with backtrace from dev-mode:</p> <pre>Uncaught TypeError: can't access property "resolved", inputAndUiData.model[currentComponent] is undefined<br>&nbsp;&nbsp;&nbsp; InputBehaviorsComponentPropsForm InputBehaviorsComponentPropsForm.tsx:282<br>&nbsp;&nbsp;&nbsp; InputBehaviorsWrapper inputBehaviors.tsx:313<br>&nbsp;&nbsp;&nbsp; React 18<br>&nbsp;&nbsp;&nbsp; Redux 9<br>&nbsp;&nbsp;&nbsp; rtkQueryErrorHandler rtkQuery-error.ts:123<br>&nbsp;&nbsp;&nbsp; Redux 2<br>&nbsp;&nbsp;&nbsp; undoRedoActionIdMiddleware store.ts:208<br>&nbsp;&nbsp;&nbsp; Redux 10<br>&nbsp;&nbsp;&nbsp; createImmutableStateInvariantMiddleware Immutable<br>&nbsp;&nbsp;&nbsp; createActionCreatorInvariantMiddleware Redux<br>&nbsp;&nbsp;&nbsp; updateSelectionInRedux useComponentSelection.ts:154<br>&nbsp;&nbsp;&nbsp; handleComponentSelection useComponentSelection.ts:201<br>&nbsp;&nbsp;&nbsp; handleComponentClick ComponentOverlay.tsx:134<br>&nbsp;&nbsp;&nbsp; React 27<br>&nbsp;&nbsp;&nbsp; workLoop scheduler.development.js:266<br>&nbsp;&nbsp;&nbsp; flushWork scheduler.development.js:239<br>&nbsp;&nbsp;&nbsp; performWorkUntilDeadline scheduler.development.js:533<br>&nbsp;&nbsp;&nbsp; js scheduler.development.js:571<br>&nbsp;&nbsp;&nbsp; js scheduler.development.js:633<br>&nbsp;&nbsp;&nbsp; __require chunk-OCBYBPSH.js:15<br>&nbsp;&nbsp;&nbsp; js index.js:6<br>&nbsp;&nbsp;&nbsp; __require chunk-OCBYBPSH.js:15<br>&nbsp;&nbsp;&nbsp; React 2<br>&nbsp;&nbsp;&nbsp; __require chunk-OCBYBPSH.js:15<br>&nbsp;&nbsp;&nbsp; js</pre><p>I don't know why this error seems to be only happening with extjs components, I debugged thoroughly but could not find any difference in the extjs components compared to a working, similar js-component. Howsoever, the component metadata of the broken components is all al-right, it has empty prop-definitions just as the working js-component.</p> <h3 id="proposed-resolution">Proposed resolution</h3> <p>I found out that the error does NOT happen when navigating FROM some certain components without having enum props, while it happens when the previous form has that. The underlying issue seems to be the that react triggers an update to the settings form before the fetched-form-response is cleared out. Clearing that manually with some useEffect was happening <a href="https://www.drupal.org/project/canvas_extjs/issues/3559252#comment-16356349">too late</a> also.</p> <p>After some <a href="https://www.drupal.org/project/canvas_extjs/issues/3559252#comment-16356214">trial and error</a> I figured out a simple and reliable fix: Skip too-early re-rendering of the instance-form by checking <code>currentComponentId != selectedComponent</code>. That reliably solves the issue and settings forms are updating as they should.</p> <h3 id="ui-changes">User interface changes</h3> <p>-</p> > Related issue: [Issue #3559252](https://www.drupal.org/node/3559252)
issue