Skip to content

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

@arnaumanyosa

Description

@arnaumanyosa

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions