pnpm resolution workarounds are deprecated
.pnpmfile.cjs readPackage hooks and pnpm.packageExtensions are deprecated. Burn-down: LIVE-37807.
Do not add a hook, a packageExtensions entry, or a public-hoist-pattern to paper over a missing dependency.
They invent a graph that package.json does not declare. That poisons nx affected (projectsAffectedByDependencyUpdates: "auto") and forces the whole lockfile into the cache hash.
Instead
- Declare it on the workspace package that imports it (
dependencies, orpeerDependencieswhen a singleton is required). - Fix upstream if a third-party package
require()s something it does not list — PR, then bump. pnpm.overrides/ catalog only pin versions; they do not replace a missing declaration.- Existing entries: shrink them. Moving a
.pnpmfile.cjshook intopackageExtensionsis the same workaround.
pnpm.patchedDependencies is a content fork, not this class of workaround. Prefer upstream; do not use a patch to inject undeclared deps. Read dependency-patches before creating or changing one.


