Skip to content

Antd ErrorList template causes runtime error when called if imported directly from the package #4953

@JBGarner-qur8

Description

@JBGarner-qur8

Prerequisites

What theme are you using?

antd

Version

6.2.5

Current Behavior

When you submit a form using the default import component from @rjsf/antd, and the form has validation errors (e.g. a missing mandatory field), a runtime error is thrown in the browser:

Uncaught Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.

Expected Behavior

As per the previous version (last tested pre-6.x), expect an error list containing the validation errors

Steps To Reproduce

  1. Clone the minimal repo
  2. npm run dev -> open the app in your browser
  3. Without filling in the form, click the submit button <-- Should work
  4. Comment out the code injecting the in-app version of the ErrorListTemplate
  5. Stop & restart the app and repeat step 3 <-- Now it breaks

Note: I've committed my "fix" as a separate commit, so you can also revert the last commit to get to an example of the "broken" state.

Environment

- OS: macOS Sequoia 15.5
- Node: 22.21.1
- npm: 10.9.4
- Browser: Chrome 144.0.7559.133

Anything else?

Minimal repo is here.

When it's just run "as is", the problem should not be reproducible, since I've found that if I copy in the rjsf/antd ErrorList template from here verbatim, and sub that into the form via my own version of the component, that seems to resolve the problem. But If I either import RJSFForm from "@rjsf/antd" or simply comment out the line when I'm injecting my own version of the template then the problem appears

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