Skip to content

fix(core): resolve lockfile cache regression with keyMap state#33448

Merged
leosvelperez merged 1 commit into
masterfrom
nxc-3443
Nov 11, 2025
Merged

fix(core): resolve lockfile cache regression with keyMap state#33448
leosvelperez merged 1 commit into
masterfrom
nxc-3443

Conversation

@leosvelperez

@leosvelperez leosvelperez commented Nov 11, 2025

Copy link
Copy Markdown
Member

After PR #33256 split lockfile parsing into separate node and dependency caches, a regression occurred where dependencies could be regenerated without nodes, leaving a shared module-level variable (keyMap) empty and causing incorrect dependency resolution.

Changes:

  • Serialize keyMap with nodes cache to maintain state between phases
  • Remove module-level shared state from pnpm, npm, and yarn parsers
  • Move keyMap creation inside getNodes functions for better encapsulation
  • Update readCachedExternalNodes to deserialize keyMap internally

@leosvelperez leosvelperez self-assigned this Nov 11, 2025
@leosvelperez leosvelperez requested review from a team and meeroslav as code owners November 11, 2025 16:10
@netlify

netlify Bot commented Nov 11, 2025

Copy link
Copy Markdown

Deploy Preview for nx-docs ready!

Name Link
🔨 Latest commit 440e4da
🔍 Latest deploy log https://app.netlify.com/projects/nx-docs/deploys/6913601557e95f0008c8ae18
😎 Deploy Preview https://deploy-preview-33448--nx-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@vercel

vercel Bot commented Nov 11, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
nx-dev Ready Ready Preview Nov 11, 2025 4:15pm

@nx-cloud

nx-cloud Bot commented Nov 11, 2025

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit 440e4da

Command Status Duration Result
nx affected --targets=lint,test,test-kt,build,e... ✅ Succeeded 35m 33s View ↗
nx run-many -t check-imports check-lock-files c... ✅ Succeeded 1m 59s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 11s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 3s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2025-11-11 16:51:56 UTC

@leosvelperez leosvelperez enabled auto-merge (squash) November 11, 2025 16:26
@leosvelperez leosvelperez merged commit 8f3b0b2 into master Nov 11, 2025
21 checks passed
@leosvelperez leosvelperez deleted the nxc-3443 branch November 11, 2025 16:52
FrozenPandaz pushed a commit that referenced this pull request Nov 14, 2025
After PR #33256 split lockfile parsing into separate node and dependency
caches, a regression occurred where dependencies could be regenerated
without nodes, leaving a shared module-level variable (`keyMap`) empty
and causing incorrect dependency resolution.

Changes:
- Serialize `keyMap` with nodes cache to maintain state between phases
- Remove module-level shared state from pnpm, npm, and yarn parsers
- Move `keyMap` creation inside `getNodes` functions for better
encapsulation
- Update `readCachedExternalNodes` to deserialize `keyMap` internally

(cherry picked from commit 8f3b0b2)
@github-actions

Copy link
Copy Markdown
Contributor

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Nov 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants