-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
precompiled validator errors on anyOf #3677
Comments
@cwendtxealth can you provide a reproducible codesandbox.io for this? Otherwise we can't figure out how to fix it. |
@heath-freenome here is codesandbox.io for the anyOf error. If you click the |
Here is an example of if/then compile errors because of subschema merge. This codesandbox tries to compile the if/then schema that is used in the playground |
I believe I found the issue for anyOf error. In utils getClosestMatchingOption it sets a I think one solution should be catching the error in AJV8PrecompiledValidator.isValid and returning This doesn't solve the if/then condition error for precompiled but I can open another ticket with more investigation into that. I think the anyOf can be solved with this solution. |
Still experiencing this issue on 5.10.0, any hints? |
@kenvenin Are you able to provide a reproducible test case? |
@heath-freenome Sorry for the late reponse, providing same sandbox but with versions changed to 5.10.0 |
@kenvenin that seems to be the old sandbox where the compile validate did not match the schema correctly. Do you have a schema sample that you are see failing? All of the complex schemas I have been using have been able to be compiled and work now. There are also a couple big fixes in 5.11.0 for compiled schema. |
I apologize, my issue is probably different, I can compile the schema but when trying to import it I see the same error "Uncaught Error: No precompiled validator function was found for the given schema for...". I'm using vite so I think it's an issue with how imports from cjs are handled in my project (I can see hashed exports that start with numbers are not being imported). Would it be troubling to ask you for an example that successfully loads a precompiled schema? |
So I ran into a similar problem because I was using the precompiled validator function dynamically without writing it to a file and could not use any tooling to transpile the javascript code. What I did is add |
There is also a fix coming to help deal with on-the-fly precompiled schemas |
Prerequisites
What theme are you using?
core
Version
5.7.0
Current Behavior
Using precompiled schema validation feature with anyOf errors when setting the anyOf field. Simple any of schema
When compiled and used with precompile feature, I get this error when trying to set the field with either boolean or string array
Expected Behavior
Form loads and handles anyOf for precompiled schemas.
Steps To Reproduce
No response
Environment
Anything else?
No response
The text was updated successfully, but these errors were encountered: