Skip to content
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

Works on local env but when deployed I get Error compiling schema #4369

Open
1 task done
arnaumanyosa opened this issue Nov 7, 2024 · 0 comments
Open
1 task done
Labels
needs triage Initial label given, to be assigned correct labels and assigned question

Comments

@arnaumanyosa
Copy link

Prerequisites

What theme are you using?

mui

What is your question?

I have multiple schemas that I get from a REST API endpoint and I use to generate different forms. I do nothing with validators, just passing the one imported directly

import Form from '@rjsf/mui'
import validator from '@rjsf/validator-ajv8'

<Form
        schema={dynamicSchema}   //Dynamic schema that I get from a REST API endpoint
        formData={formData}
        validator={validator}   //the one imported from '@rjsf/validator-ajv8'
        liveValidate={true}
        ...
      >
        <></>
</Form>

This works perfectly on my local. But on production environment I get a very long error message on my browser console that starts like:

Error compiling schema, function code: const schema0 = scope.schema[0];return function validate0(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == "object" && !Array.isArray(data)) ...
1- Why I don't have this error on my local?
2- I read the documentation and discussions like this one, seems like I have to build a custom validator for each of my schemas. Is that correct?
3- Seems like this custom validators should be build on the server. Can I build them on the browser? How?

@arnaumanyosa arnaumanyosa added needs triage Initial label given, to be assigned correct labels and assigned question labels Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Initial label given, to be assigned correct labels and assigned question
Projects
None yet
Development

No branches or pull requests

1 participant