Search code examples
reactjscreate-react-appajv

Error "custom keyword definition is invalid: data.errors should be boolean"


I just created a new React application using this command:

create-react-app mysite.com

After installation, when I tried to open it using npm start and yarn start, I got the following error.

throw new Error('custom keyword definition is invalid: '  + this.errorsText(validateDefinition.errors));
      ^

Error: custom keyword definition is invalid: data.errors should be boolean
    at Ajv.addKeyword (/Users/myAccount/Documents/Dev/Projects/ReactJS/mysite.com/node_modules/ajv/lib/keyword.js:65:13)

How can I fix this problem?


Solution

  • Reverting to a stable version of the ajv library also works:

    npm uninstall ajv
    npm install [email protected]