-
Notifications
You must be signed in to change notification settings - Fork 352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uncaught RangeError: Maximum call stack size exceeded when oneOf contains a very large number of items #2271
Comments
As you noticed, the error comes from the validation framework Ajv we are using. See this open issue (ajv-validator/ajv#1705) for more details. There’s not much we can do about that except for waiting for a fix. However there are some workarounds you can use:
|
@sdirix Thanks for the quick response. Just to put it out there, if it helps anybody else. I've tried to bypass the issue by using |
You can use the second workaround I posted and just always activate it whenever there is a oneOf with more than X entries in your retrieved schema. There really is no downside to that workaround besides the loss of validation for the oneOf. That validation is almost always meaningless anyway as the UI already makes sure that only a valid value is stored in the form data. |
@sdirix |
Describe the bug
When trying to load a schema with a oneOf field specifying a list of over 300 items (approximately) and validation mode: ValidateAndShow, it fails to render the form with the following errors:
Expected behavior
In this case I am expecting it to be able to render a list of 500 items at least including validations without issues.
Steps to reproduce the issue
Use a json schema with a oneOf that specifies 500 items to make sure you reproduce.
Something like below
Screenshots
No response
Which Version of JSON Forms are you using?
v3.1.0
Framework
No response
RendererSet
No response
Additional context
I could successfully render with less than 300 items in the
oneOf
field, or just by disabling the validation which is not an option unfortunately.I've also traced some similar issues in the ajv library that handles validation here ajv-validator/ajv#1581 (comment) . Note that I've tried the proposed resolutions at the link and they do not work in this case.
The text was updated successfully, but these errors were encountered: