Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 222
Ishan Patel Avatar asked Feb 09 '19 23:02

Ishan Patel


2 Answers

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

npm uninstall ajv
npm install [email protected]
like image 193
Roberto Rodriguez Avatar answered Oct 22 '22 17:10

Roberto Rodriguez


I thought that was something new coming with "@symfony/webpack-encore": "^0.23.0". However, there's an issue with the ajv library.

Dirty fix:

In

node_modules\ajv-errors\index.js

change the errors: parameter at line 14 from 'full' to true.

Clean fix (temporary):

Modify your package.json using this:

"resolutions": {
    "ajv": "6.8.1"
}
like image 10
rnenciu Avatar answered Oct 22 '22 18:10

rnenciu