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
When nx cache is enabled, the output of the packages can mismatch the actual changes in the source code when lerna watch is used and code is changed rapidly (around 5 times in 3 seconds on Mac M1 Pro). In particular, different cache entries (obviously with different cache hash) have the same output result.
Please see the reproduction section, but it seems like something described in the scheme below is going on (please note that the problem is reproducible when multiple changes are made to the same file in a matter of second while lerna watch is running)
If nx cache is disabled in repository, problem goes away (but all the benefits of nx caching are gone).
Expected Behavior
When nx cache is enabled, all cached outputs are unique (there are no same outputs for different cache hashes) and they correspond to the actual source code that results in outputs.
Steps to Reproduce
⚠️ The steps below reproduce the issue from scratch in your local copy, but sashuk/picasso-test#2 already has .nx/cache folder added, so feel free to analyze the cache folder itself as it is exactly the same data that is a result of actions in screencasts below (so, there is no need to check it out and run locally)
At some point you will see that there are more than one cache record for the same change bg-red-14 (or any other class name that you have collided), search term ref: ref, className: twMerge('bg-red-14
You can identify which of the matching outputs does not belong to its cache hash. In the example below, build:package cached outputs are restored for bg-red-13 and bg-red-14 changes and the cache stored in .nx/cache/1235... folder belong to bg-red-13 cache hash, but it contains the output for bg-red-14 change
Current Behavior
When nx cache is enabled, the output of the packages can mismatch the actual changes in the source code when
lerna watch
is used and code is changed rapidly (around 5 times in 3 seconds on Mac M1 Pro). In particular, different cache entries (obviously with different cache hash) have the same output result.Please see the reproduction section, but it seems like something described in the scheme below is going on (please note that the problem is reproducible when multiple changes are made to the same file in a matter of second while
lerna watch
is running)If nx cache is disabled in repository, problem goes away (but all the benefits of nx caching are gone).
Expected Behavior
When nx cache is enabled, all cached outputs are unique (there are no same outputs for different cache hashes) and they correspond to the actual source code that results in outputs.
Steps to Reproduce
.nx/cache
folder added, so feel free to analyze the cache folder itself as it is exactly the same data that is a result of actions in screencasts below (so, there is no need to check it out and run locally)npx nx reset
, startnx
daemon if it has not startedyarn start
packages/base/Paper/src/Paper/Paper.tsx
bg-red-14
tobg-red-15
, tobg-red-16
, etc, practically like in the video belowKapture.2024-05-14.at.16.18.47.mp4
bg-red-14
(or any other class name that you have collided), search termref: ref, className: twMerge('bg-red-14
build:package
cached outputs are restored forbg-red-13
andbg-red-14
changes and the cache stored in.nx/cache/1235...
folder belong tobg-red-13
cache hash, but it contains the output forbg-red-14
changeKapture.2024-05-14.at.16.25.03.mp4
Environment
build:package
command https://github.com/sashuk/picasso-test/blob/master/nx.json#L12, the output is thedist-package
folder in every packagebuild:package:watch
command (https://github.com/sashuk/picasso-test/blob/demo-lerna-nx-problem/package.json#L23) that utiliseslerna watch
command and rebuilds packages that were updatednpx lerna info
The text was updated successfully, but these errors were encountered: