You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: createCacheKey 30.5 keys on the whole project config, so multi-project runs stop sharing transforms #16479
Two projects with the same @swc/jest transform and the same id (so they share one transform cache directory). Both import nanoid, which is transformed (transformIgnorePatterns: []).
npm install
npm run count (cold run of both projects, then counts files under .jc/jest-transform-cache-*)
Add "overrides": { "@jest/create-cache-key-function": "30.4.1" } to package.json, rm -rf node_modules package-lock.json && npm install, run npm run count again
@jest/create-cache-key-function
project a
project b
a + b
30.4.1
14
14
16
30.5.1 (Jest 30.5.2)
14
14
24
Expected behavior
A file transformed by the same transformer with the same transformer options is cached once and reused by every project, as in 30.4.1.
Actual behavior
Each project transforms and caches the shared files again.
#16331 added the stringified project config to the key built by createCacheKey, so that editing a transformer's settings invalidates its cache. The project config also differs per project (rootDir, displayName, setup files), so projects no longer share cache entries.
Additional context
We hit this in a Yarn workspaces monorepo with 100+ packages, one Jest project per package, and ~3 GB of node_modules. Leaving the project config out of the key for node_modules files cut the transform cache by ~90% and our CI test time by ~35%.
Suggestion: hash the transformer's own config (transformerConfig, its transform entry) instead of the full project config. Editing a transformer's settings would still invalidate its cache, without splitting the cache per project.
Environment
System:
OS: macOS 26.7
CPU: (14) arm64 Apple M4 Pro
Binaries:
Node: 24.21.0
npm: 11.19.0
npmPackages:
jest: 30.5.2 => 30.5.2
Activity
github-actions commentedon Oct 31, 2026
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.