Fix build: force ajv@8 to resolve MODULE_NOT_FOUND in react-scripts build#84
Merged
HolimaX merged 1 commit intoJun 3, 2026
Conversation
ajv-keywords@5 (used by react-scripts@5/webpack5) requires ajv@8's codegen API (ajv/dist/compile/codegen), but --legacy-peer-deps allows ajv@6 to be installed, causing the build to fail with "Cannot find module 'ajv/dist/compile/codegen'". Add an explicit `npm install ajv@^8.12.0` step after the main install to ensure the correct version is present.
20c8ab6
into
feature/Add-Android14-HSGalaxyRing-NFTMint
1 of 6 checks passed
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.
Summary
Error: Cannot find module 'ajv/dist/compile/codegen'ajv-keywords@5(a transitive dep ofreact-scripts@5/webpack5) requiresajv@8, but--legacy-peer-depsallowsajv@6to be installed instead, causing the module lookup to fail at build timenpm install ajv@^8.12.0 --legacy-peer-depsstep immediately after the mainnpm i, ensuring the correct ajv version is on disk before the build runsTest plan
CI=false && npm run prestart && npm run build-nix --verbosepasses without theajv/dist/compile/codegenerrorhttps://app.circleci.com/agents/gh/HolimaX/chat/88624cff-315b-46a8-b738-b3e1b52da150