Skip to content

TypeError: Cannot read properties of null (reading '__errors') in Form.filterUndefinedErrors  #4306

@christian-fischer

Description

@christian-fischer

Prerequisites

What theme are you using?

core

Version

5.20.0

Current Behavior

We noticed the following error:

TypeError: Cannot read properties of null (reading '__errors')
    at  (../node_modules/@rjsf/core/src/components/Form.tsx:611:79)
    at iteratee (../node_modules/lodash/_createBaseFor.js:17:10)
    at baseFor (../node_modules/lodash/_baseForOwn.js:13:19)
    at eachFunc (../node_modules/lodash/_createBaseEach.js:17:13)
    at func (../node_modules/lodash/forEach.js:38:9)
    at errors (../node_modules/@rjsf/core/src/components/Form.tsx:608:15)
    at filterUndefinedErrors (../node_modules/@rjsf/core/src/components/Form.tsx:612:10)
    at iteratee (../node_modules/lodash/_createBaseFor.js:17:10)
    at baseFor (../node_modules/lodash/_baseForOwn.js:13:19)
    at eachFunc (../node_modules/lodash/_createBaseEach.js:17:13)

Expected Behavior

No error

Steps To Reproduce

So far I've been unable to reproduce this issue.

But based on the stacktrace I could pinpoint it to this location:
4d3094c#diff-704dadefdc8b52ac02d6712540e5734214e9699c66d1d673ded1c57e96df9303R611

Looks like this was newly introduced with version 5.20.0

Environment

- OS: Mac OS X 10.15.7
- Node: v20.11.1
- npm: 10.8.2

Anything else?

Proposed solution:

  • it might mitigate the issue to replace the check for undefined in line 609 of Form.tsx with a lodash isNil call instead

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions