Closed caldempsey closed 5 years ago
Same error for me #942 here using vue.js
Is there a workaround to use an earlier release?
I hope it get noticed fast
Using nuxt for vue. My solve is doing npm i -d ajv@5.0.0
and i can run npm run dev
again. This was a fresh nuxt project I started.
This is certainly related to the latest changes made in the commit history.
Add
"resolutions": {
"ajv": "6.8.1"
}
to your package.json will create a work around (I am using yarn, don't know if it will work for npm)
@epoberezkin can we roll back?
Can confirm, this is happening for me too when scaffolding Vue JS projects. Currently on Vue CLI 3.4.0, Mac OS 10.13.4. Please fix soon as this is causing serious delays.
@velocity-360 see my comment, use the work around! 😄
Seeing the same thing when using latest storybook
4.1, reproducible by simply running the bin build-storybook
included in the same package. This entirely breaks a very large ecosystem.
Error: custom keyword definition is invalid: data/errors should be boolean
at Ajv.addKeyword (/home/csvan/IdeaProjects/pros-ui-components/module/node_modules/ajv/lib/keyword.js:66:13)
at module.exports (/home/csvan/IdeaProjects/pros-ui-components/module/node_modules/ajv-errors/index.js:10:7)
at Object.<anonymous> (/home/csvan/IdeaProjects/pros-ui-components/module/node_modules/schema-utils/src/validateOptions.js:22:1)
at Module._compile (internal/modules/cjs/loader.js:734:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:745:10)
at Module.load (internal/modules/cjs/loader.js:626:32)
at tryModuleLoad (internal/modules/cjs/loader.js:566:12)
at Function.Module._load (internal/modules/cjs/loader.js:558:3)
at Module.require (internal/modules/cjs/loader.js:663:17)
at require (internal/modules/cjs/helpers.js:20:18)
@velocity-360 see my comment, use the work around! 😄
@yooouuri thank you however, I am currently contracted to create a Vue tutorial series for a large educational software company and do not think it would be wise to kick off the series with a work-around immediately on the first step. I will wait for resolution.
@velocity-360 makes sense
@velocity-360 I'm trying to write a technical test for a job interview in React! :rofl:
lol @mmacheerpuppy exact same situation for me
@rickyTony I spent some time debugging and it seems like latest AJV is a dependency for ESLint which may produce a collision. You can use npm ls ajv
to check this out.
workaround for yarn users: add
"resolutions": {
"ajv": "6.5.5"
}
to your package.json and re run yarn install
looks like https://github.com/epoberezkin/ajv/issues/941#issuecomment-462087631 beat me to that 😅
@mmacheerpuppy I kinda ran out of time for the day debugging, so hopefully it's fixed when I get back to it tomorrow
"dependencies": {
"react": "^16.8.1",
"react-dom": "^16.8.1",
"react-scripts": "2.1.3",
"ajv": "6.8.1"
}
this worked for me using npm
@gregoriB I'm using create-react-app
and unfortunately, I'm still getting the error after adding that 😞
@sky-coding You say that as if we don't have dependency chains on the back-end! @andrewtet can you kindly show your package.json?
@andrewtet did you run npm install afterwards?
i think npm users can use this workaround https://github.com/rogeriochaves/npm-force-resolutions
Can confirm for React users it's ESLint and ESLint addons which are causing the issue in the dependency chain. Removing these and running npm install && npm start
was sufficient to get me back on development.
{
"eslint": "5.6.0",
"eslint-config-airbnb": "^17.1.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-jsx-a11y": "^6.1.1",
"eslint-plugin-react": "^7.11.0",
}
So if you're in a hurry to get back on it, its time to get bare with React!
just add
"resolutions": {
"ajv": "6.8.1"
}
to your package.json
if you use yarn:
run yarn install
if you use npm: https://github.com/rogeriochaves/npm-force-resolutions TL;DR
rm -rf node_modules
npx npm-force-resolutions
npm install
@gregoriB Yeah, I ran npm i
after adding "ajv": "6.8.1"
to my package.json and it didn't work.
I tried again with "ajv": "6.8.1"
in my package.json and ran rm -rf node_modules
, npm cache clean --force
, and then npm i
and that did the trick. I've now got create-react app up and running.
@andrewtet yeah I just did the it "proper" way too. Not sure why the other way worked for me and not you though
I fixed this issue by resorting to an old version that I knew worked. Ran this npm install --save ajv@6.6.2
@ChuntaoLu You say that as if we don't have dependency chains on the back-end! @andrewtet can you kindly show your package.json?
Wrong @ ?
@ChuntaoLu yes, sorry!
I have applied the workaround and it worked. Thanks.
same issue node_modules\ajv\lib\keyword.js:65 throw new Error('custom keyword definition is invalid: ' + this.errorsText(validateDefinition.errors));
my solution is:
"dependencies": { "ajv": "6.8.1" }, "resolutions": { "ajv": "6.8.1" }
@epoberezkin I proposed a temporary fix which, hopefully, fixes the problem in dependent packages and removes the need for a full rollback. Let me know if you see any other issues regarding this. Perhaps you prefer a different solution, that's fine too. I'm just trying to help speed up the resolution
For vue.js, it still doesn't work. There are too many dependencies that we cannot fix them one by one
it is 3:30am london time, so a few more hours before @epoberezkin wakes up and releases a new version, time to go do something else for a bit!
Released right before going to bed, I figured as much. Typical :)
Hey @epoberezkin we have reported upstream workaround in our linked issue webpack/webpack#8768 so hopefully this reduces the chatter while this is being tackled by your team or other AJV contributors.
If there is anything we can do to help, let us know. - webpack team
Thanks for the patience, going to fix https://github.com/epoberezkin/ajv/commit/7079aed19599fd13c95412b181fd2c08feb1debb - I think I know what the issue is.
errors
can also be "full"
...
released 6.9.1
released 6.9.1
thanks, just test with ajv@6.9.1 and it works now.
Please let me know if somebody is still affected. The validation of custom keyword was simply incorrect, and now it is fixed. But it is still a bit more restrictive than it was - it would only fail though if e.g. somebody used 0
instead of false
, which seems unlikely.
It probably is possible to make travis CI run tests of some dependencies against the new tags (e.g. webpack and eslint).
@epoberezkin thanks for the fix!
closing
What version of Ajv are you using? Does the issue happen if you use the latest version?
Latest version (6.9.0 release I believe)
Ajv options object
What results did you expect?
Expected to be able to build node_modules but experiencing above stacktrace.
Are you going to resolve the issue? Current workaround is to remove ESLint dependencies for NPM users, or if using YARN to resolve dependencies to forced version. It's also possible (with the addition of another dependency) to use NPM resolutions (see conversation).
Reproduction
Try using the following packages declaration. npm post install will fail to start. ESLint relies on AJV.