fix(NOJIRA-123): clean stale nested node_modules on cache restore-key fallback#226
Merged
kb-typeform merged 1 commit intomainfrom Apr 14, 2026
Merged
Conversation
… fallback When actions/cache restores via restore-key fallback (not exact match), yarn install --frozen-lockfile does not delete leftover nested node_modules/ dirs from the stale cache. This causes version conflicts during major dependency migrations (e.g., @types/react@17 persisting inside echo-ui/node_modules after upgrading to React 18). Add a cleanup step that detects restore-key fallback and purges all nested node_modules directories before yarn install runs.
aff3a7f to
84feb1c
Compare
|
|
🥷 Code experts: no user but you matched threshold 10 kb-typeform has most 👩💻 activity in the files. See details
Activity based on git-commit:
Knowledge based on git-blame:
Activity based on git-commit:
Knowledge based on git-blame: ✨ Comment |
miquelarranz
approved these changes
Apr 14, 2026
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.



Overview
Fix stale cache restore-key fallback causing version conflicts during major dependency migrations (e.g., React 17→18). When
actions/cacherestores via restore-key fallback,yarn install --frozen-lockfiledoes not delete leftover nestednode_modules/from the stale cache, causing TypeScript type mismatches.Context: https://github.com/Typeform/share-web/pull/960 — share-web had to add a postinstall hack to work around this.
Changes
setup-node-with-cache/action.ymlcache-hit != true) and purge all nestednode_modules/directories inside dependencies beforeyarn installpackages/*/,apps/*/).yarn-integrityon fallback to force full resolutionImpact
find+rm -rf, but prevents broken builds from stale transitive dependencies