Nx "externalDependencies are not hashed" in CI
An Nx target depends on an external tool or package whose version is not part of the cache hash. CI then restores a stale cached build that does not reflect the changed tool.
What this error means
A target shows "existing outputs match the cache, left as is" in CI even though a dependency or external CLI changed, producing a build that is silently out of date.
> nx run web:build [existing outputs match the cache, left as is]
# but the external bundler version changed and was not in the hash inputsCommon causes
External tools missing from inputs
The target hash does not include externalDependencies, so a changed CLI or package version does not invalidate the cache.
Over-broad cache reuse
Default inputs hash only project files, not the toolchain, letting an external change slip past the cache key.
How to fix it
Add externalDependencies to the target inputs
Declare the external packages the target depends on so their version becomes part of the hash.
// project.json
{ "targets": { "build": { "inputs": ["production", { "externalDependencies": ["esbuild", "typescript"] }] } } }Use the all-external-dependencies input when unsure
For tasks sensitive to the whole toolchain, include all external deps in the hash inputs.
{ "namedInputs": { "production": ["default", { "externalDependencies": ["*"] }] } }How to prevent it
- List externalDependencies in target inputs for tool-sensitive tasks.
- Treat the toolchain version as part of the cache key.
- Audit cache hits in CI when external tools are upgraded.