fix: add ajv@^8.20.0 to devDependencies to resolve npm run dev crash#60
Open
YASHMAHAKAL wants to merge 1 commit intolayer5io:masterfrom
Open
fix: add ajv@^8.20.0 to devDependencies to resolve npm run dev crash#60YASHMAHAKAL wants to merge 1 commit intolayer5io:masterfrom
YASHMAHAKAL wants to merge 1 commit intolayer5io:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
npm run devfails out of the box with:Root Cause
Two devDependencies pull conflicting versions of
ajvinto the tree:eslint@10.xrequiresajv@^6.x→ gets hoisted to top-levelnode_modules/ajvwebpack/webpack-dev-server→schema-utils@4.x→ajv-keywords@5.x→ peer requiresajv@^8.xajv-keywords@5.xis hoisted to the top level and resolvesajvfromnode_modules/ajv— which is v6. The pathajv/dist/compile/codegendoes not exist in v6, causing the crash.Fix
Add
ajv@^8.20.0todevDependencies. npm hoists v8 to the top level (direct dep wins),ajv-keywordsfinds v8 there and works. ESLint gets its own nested v6 copy atnode_modules/eslint/node_modules/ajvand is unaffected.ajvis placed indevDependenciesand notdependenciesbecause it has no relation to what this library exports — it is purely a dev toolchain version pin. Library consumers should not inherit it.Testing
npm run devstarts without error ✅npm run buildpasses ✅npm test234/234 pass ✅Signed commits