简体   繁体   中英

create-react-app react-scripts start - ajv-errors: NOT SUPPORTED: option jsonPointers. Deprecated jsPropertySyntax can be used instead

Seeing this error after coming back to a project after a few weeks. Changed/updated nothing, everything was working fine last time I had this laptop open. The following error happens in a container when I'm running docker-compose up .

    yarn run v1.22.17
client    | $ react-scripts start
client    | NOT SUPPORTED: option jsonPointers. Deprecated jsPropertySyntax can be used instead.
client    | /app/node_modules/ajv-errors/index.js:4
client    |   if (!ajv._opts.allErrors) throw new Error('ajv-errors: Ajv option allErrors must be true');
client    |                  ^
client    | 
client    | TypeError: Cannot read properties of undefined (reading 'allErrors')
client    |     at module.exports (/app/node_modules/ajv-errors/index.js:4:18)
client    |     at Object.<anonymous> (/app/node_modules/webpack-dev-server/node_modules/schema-utils/src/validateOptions.js:22:1)
client    |     at Module._compile (node:internal/modules/cjs/loader:1103:14)
client    |     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1155:10)
client    |     at Module.load (node:internal/modules/cjs/loader:981:32)
client    |     at Function.Module._load (node:internal/modules/cjs/loader:822:12)
client    |     at Module.require (node:internal/modules/cjs/loader:1005:19)
client    |     at require (node:internal/modules/cjs/helpers:102:18)
client    |     at Object.<anonymous> (/app/node_modules/webpack-dev-server/node_modules/schema-utils/src/index.js:7:25)
client    |     at Module._compile (node:internal/modules/cjs/loader:1103:14)
client    | error Command failed with exit code 1.
client    | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
client exited with code 1

So posting my own question I changed how I was looking at the problem.

I came across this question/answer AJV and ajv-formats latest must be broken in React

I found the answer from @Tsar Bomba about installing

npm install ajv@7.2.3 ajv-errors@2.0.1 ajv-formats@2.1.1 --save

Worked for me and I was able to serve my project again

The following also worked for me.

npm install ajv@7.2.3 ajv-errors@2.0.1 ajv-formats@2.1.1 --save

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM