fix(angular): pin Angular dependencies to exact versions to fix npm install ERESOLVE - #1878
Merged
Conversation
ion-label is a scoped Stencil component whose slotted text is relocated asynchronously starting in @ionic/angular 8.8.0, so reading textContent right after a single detectChanges() returns an empty string even though the text is in the DOM. Awaiting fixture.whenStable() lets slot hydration finish before the assertion (ROU-10799).
2 tasks
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.
What is the current behavior?
Currently, running
ionic start <name> blank --type=angular(orangular-standalone) fails onnpm installwith anERESOLVEerror. The starters ship without a lockfile, and the Angular basepackage.jsonused^20.0.0caret ranges for the@angular/*packages. The Angular ecosystem pins its packages to each other exactly (@angular/animations@Xrequires@angular/core@Xand@angular/common@Xexactly,@angular/compiler-cli@Xrequires@angular/compiler@Xexactly), so when npm resolves the caret ranges to inconsistent patch versions (e.g.@angular/core@20.1.8alongside@angular/compiler@20.3.25) the exact peer deps become unsatisfiable. A fresh CI cache happens to resolve everything to the same latest patch and works, which is why this only started showing up on developer machines with older cached metadata.What is the new behavior?
@angular/*,@angular-eslint/*, and@angular-devkit/build-angularare now pinned to exact versions in bothangular/baseandangular-standalone/base. Without a lockfile this is the only thing that guarantees npm resolves a single consistent version set, so there's nothing left for the resolver to mix. This matches whationic-angular(the legacy starter) already does. Loosely-peered packages (@ionic/*,ionicons,eslint,typescript,karma/jasmine) stay on caret ranges since they don't have the exact-peer constraint.Does this introduce a breaking change?
Other information
Verified a fresh, no-lockfile
npm install+npm run build+npm test. Also confirmed the other current starters install cleanly from a fresh resolution:react-viteandvue-vite(and the legacyreact/vue). Only the Angular ecosystem has this exact-peer fragility, so they're the only dirs that needed the change.Note: pinning means the starters won't pick up new Angular patches until someone bumps them, which is the tradeoff for reliable installs without a lockfile (which this repo intentionally avoids)