Skip to content

"TypeError: Cannot read property 'shallowEqualKeys' of undefined" if loading a spec from localStorage #2099

@hkosova

Description

@hkosova

Q&A (please complete the following information)

  • OS: Windows 10
  • Browser: Chrome, Firefox, Edge latest
  • Method of installation: https://editor.swagger.io
  • Swagger-Editor version: 3.8.0
  • Swagger/OpenAPI version: OpenAPI 3.0

Describe the bug you're encountering

If you paste the spec provided below into Editor and then refresh the page, this causes many console errors, and schemas cannot be expanded in the UI.

Steps to reproduce

  1. Open an Incognito/Private window in your browser.
  2. Open the browser dev tools.
  3. Go to https://editor.swagger.io.
  4. Clear the default contents (Ctrl+A, Del), and paste the following spec:
openapi: 3.0.0
info:
  title: test
  version: 0.0.0
paths: {}
components:
  schemas:
    MySchema:
      type: string
      enum:
        - foo
        - bar

=> Note that UI is rendered correctly, and there are no errors in the browser console.
5. Refresh the editor page (F5).
6. Try to expand the schema in the UI.

Actual results

Schema cannot be expanded in the UI, and there are errors in the browser console:

TypeError: Cannot read property 'shallowEqualKeys' of undefined
    at t.value (components.jsx:24)
    at updateComponent (ReactCompositeComponent.js:625)
    at u.receiveComponent (ReactCompositeComponent.js:544)
    at Object.receiveComponent (ReactReconciler.js:122)
    at Object.updateChildren (ReactChildReconciler.js:107)
    at K._reconcilerUpdateChildren (ReactMultiChild.js:209)
    at K._updateChildren (ReactMultiChild.js:308)
    at K.updateChildren (ReactMultiChild.js:295)
    at K._updateDOMChildren (ReactDOMComponent.js:944)
    at K.updateComponent (ReactDOMComponent.js:758)

Expected results

No console errors. Schema can be expanded in the UI.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions