Happens with any configuration
I was working on trying to fix a performance issue in Swagger when I noticed a console error unrelated to my changes. You can reproduce the error simply by clicking on the 'model' of a request.

Steps to reproduce the behavior:
Body parameterNo error messages.

I have not been able to reproduce the issue with V3.31.1 so this error must have been introduced recently.
In Chrome, the error is:
Uncaught TypeError: Cannot read property 'getScrollToKey' of undefined
at model-collapse.jsx:69
at ReactRef.js:18
at Object.o.attachRefs (ReactRef.js:40)
at $.o (ReactReconciler.js:21)
at e.notifyAll (CallbackQueue.js:74)
at p.close (ReactReconcileTransaction.js:78)
at p.closeAll (Transaction.js:207)
at perform (Transaction.js:154)
at y.perform (Transaction.js:141)
at y.perform (ReactUpdates.js:87)
This issue also prevents nested models from being expanded.
Steps to reproduce:
photoUrls or tags subschemas, or the enum of the status property.Expected results: Subschemas and enums are expanded.
Actual result: Subschemas and enums are NOT expanded.
I'm getting this error even after rebuilding the latest version of the docker image. Is the fix released already or I need to wait more? It's odd that the error prevents me from expanding only some object, while others work. It doesn't matter if they are new or old, seems just random.
In Chrome, the error is:
Uncaught TypeError: Cannot read property 'getScrollToKey' of undefined at model-collapse.jsx:69 at ReactRef.js:18 at Object.o.attachRefs (ReactRef.js:40) at $.o (ReactReconciler.js:21) at e.notifyAll (CallbackQueue.js:74) at p.close (ReactReconcileTransaction.js:78) at p.closeAll (Transaction.js:207) at perform (Transaction.js:154) at y.perform (Transaction.js:141) at y.perform (ReactUpdates.js:87)This issue also prevents nested models from being expanded.
Steps to reproduce:
- Open https://petstore.swagger.io.
- Open the browser dev toops > Console tab.
- Scroll down to the Models section.
- Expand the "Pet" model.
- Try to expand the
photoUrlsortagssubschemas, or the enum of thestatusproperty.Expected results: Subschemas and enums are expanded.
Actual result: Subschemas and enums are NOT expanded.
Do you have any solution for the moment?
@Stenfrank I'm also getting the error Uncaught TypeError: Cannot read property 'getScrollToKey' of undefined
The fix for this issue will be in this week's release.
Fixed in v. 3.32.2.
In Chrome, the error is:
Uncaught TypeError: Cannot read property 'getScrollToKey' of undefined at model-collapse.jsx:69 at ReactRef.js:18 at Object.o.attachRefs (ReactRef.js:40) at $.o (ReactReconciler.js:21) at e.notifyAll (CallbackQueue.js:74) at p.close (ReactReconcileTransaction.js:78) at p.closeAll (Transaction.js:207) at perform (Transaction.js:154) at y.perform (Transaction.js:141) at y.perform (ReactUpdates.js:87)This issue also prevents nested models from being expanded.
Steps to reproduce:
- Open https://petstore.swagger.io.
- Open the browser dev toops > Console tab.
- Scroll down to the Models section.
- Expand the "Pet" model.
- Try to expand the
photoUrlsortagssubschemas, or the enum of thestatusproperty.Expected results: Subschemas and enums are expanded.
Actual result: Subschemas and enums are NOT expanded.
Hi all,
Hi. I am still having this issue in swagger-ui-express. :(
@Kenan13 please open a new issue and fill in the requested information in the issue template.
Most helpful comment
The fix for this issue will be in this week's release.