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
- Clone the minimal repo
npm run dev -> open the app in your browser
- Without filling in the form, click the submit button <-- Should work
- Comment out the code injecting the in-app version of the ErrorListTemplate
- 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
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:Expected Behavior
As per the previous version (last tested pre-6.x), expect an error list containing the validation errors
Steps To Reproduce
npm run dev-> open the app in your browserNote: 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
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
ErrorListtemplate 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 eitherimport RJSFForm from "@rjsf/antd"or simply comment out the line when I'm injecting my own version of the template then the problem appears