fix: oom during test template #551 - #182
Closed
abosio wants to merge 2 commits into
Closed
Conversation
npm was OOMing (~4GB heap) while resolving peer dependency conflicts introduced by recent package releases (eslint 9.39.4, graphql-codegen 7.1.3). The ERESOLVE algorithm's memory use balloons with this many conflicting packages. Using --legacy-peer-deps skips that resolution path, matching the approach already used in the compile-frontend target.
Installing all packages in one shot causes npm's resolver to exhaust ~4GB of heap. Batching into groups of 5 keeps each resolution small enough to complete. Dropping --legacy-peer-deps restores strict peer dep enforcement, which prevents ESLint 10 from being installed (eslint-config-next constrains to ^9, and it resolves in the same batch as eslint).
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.
npm was OOMing (~4GB heap) while resolving peer dependency conflicts introduced by recent package releases (eslint 9.39.4, graphql-codegen 7.1.3). The ERESOLVE algorithm's memory use balloons with this many conflicting packages. Using --legacy-peer-deps skips that resolution path, matching the approach already used in the compile-frontend target.
With --legacy-peer-deps, npm ignores peer dependency constraints entirely, so it installs eslint@10.5.0 (latest) and just warns. That's what caused the breakage.
Without --legacy-peer-deps, npm enforces peer deps. When eslint and eslint-config-next land in the same batch (they do — lines 12 and 13 → batch 3 with -n 5), npm resolves eslint to the latest version satisfying all constraints in that batch. The constraint from eslint-config-next (^7||^8||^9) is the binding one, so npm picks the latest eslint 9.x instead of 10.x.
The -n 5 batching is necessary to ensure they're resolved together in one npm install invocation — if eslint were in an earlier batch without eslint-config-next, npm would have no constraint to apply and would install 10.x first. Then when eslint-config-next arrived in a later batch, npm would either ERESOLVE or install a conflicting copy.