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
Configured like this I would expect that if the cache key forbravo:build orcharlie:build were to change it would result in an invalidation ofalpha:build as well. Otherwise what would be the point of declaring it as a dependency?
Reproduce the problem
nx reset
Runnx run alpha:build this caches output fromalpha:build,bravo:build andcharlie:build.
This results in a built artifactpackages/alpha/built/alpha.js containing old code.
import*ashttpfrom"node:http";constcharlie=(message)=>{return`Inner wrap:${message}`;// Notice this does not include " changed"};constbravo=(message)=>{returncharlie(`Outer wrap:${message}`);};constport=8088;http.createServer(async(_,res)=>{res.writeHead(200,{"Content-Type":"text/plain","access-control-allow-origin":"*","access-control-allow-methods":"GET, OPTIONS"});res.write(`Hello world @${(/*@__PURE__ */newDate()).toISOString()}From libs:${bravo("Hello from API")}`);res.end();}).listen(port);console.log(`http://localhost:${port}`);
Workaround
I can get the "correct" behaviour by adding^project to the inputs ofbuild inalpha as shown in thealpha:buildChain target, but this would require thatalpha knows what inputs should invalidate all dependent targets up the chain for all projects.