Comments (4)
Thanks for reporting this!
The issue happens because of a constraint regarding build target names (https://nx.dev/recipes/angular/setup-incremental-builds-angular#build-target-name). What's happening is that the target with an executor that supports incremental builds in your containers
library now has a different name (build-angular
) while its dependencies (e.g. the project that contains the file/from/another/lib
path) probably still have build
. The way incremental builds currently work, the target names should be the same.
We are trying out (and plan to enable it by default) a new way of calculating the target dependencies for incremental builds that should not be constrained by this. Could you try running your command with the NX_BUILDABLE_LIBRARIES_TASK_GRAPH=true
env var and let me know if it works?
from nx.
thanks for your response @leosvelperez but no luck :(
from nx.
hey @PatoDeVille! Apologies for the delay in getting back to you.
One thing I missed last time is that we need to make sure the task graph has the correct dependencies so Nx can properly figure out the buildable libs dependencies. To do so, please update your targetDefaults
in nx.json
and add the following:
{
...
"targetDefaults": {
...
"build-angular": {
"dependsOn": ["^build"]
},
},
...
}
With that in place, you can build your library (or app) setting the env var I mentioned in my last comment:
NX_BUILDABLE_LIBRARIES_TASK_GRAPH=true nx build my-lib
NX_BUILDABLE_LIBRARIES_TASK_GRAPH=true nx build my-app
The important bit is that any target using one of the Nx executors that supports incremental builds (e.g. @nx/angular:package
) must specify the tasks it depends on. In this case, the build-angular
task uses the @nx/angular:package
executor, and it depends on projects that use the build
task with a similar executor. That's why we need to set up that dependency in the build pipeline. Additionally, the NX_BUILDABLE_LIBRARIES_TASK_GRAPH
env var enables a new way of calculating those dependencies relying on the task graph and not just on the target name (previous behavior).
Please let me know if you still have any issues after making the adjustments above.
from nx.
I'm closing this since a solution was provided in #22043 (comment) (I tested it in a repo with a similar setup as this issue's description).
@PatoDeVille, if you still have any issues after following the instructions on that comment, please leave a message, and I'll take a look.
from nx.
Related Issues (20)
- [nx/vite] [19.1.0] Vitest runs in watch mode by default? (or should we add a coverage target?) HOT 6
- Nx migrate to v19 issues HOT 3
- After migration to 19.1.0 -> findCacheDirectory is not a function HOT 3
- Can't use enforce-module-boundaries when running ESLint directly
- nx release publish launch 'npm dist-tag add' command on a package version which does not exists on the npm registry
- nx release version ignore changes to a package when the associated commit comes from the github "squash and merge" command
- Project Crystal: Using a custom plugin causes the jest plugin to crash HOT 2
- nx.bat prints out its entire contents when it's run
- `npx nx@latest init` fails on Windows when installing `nx/gradle` plugin
- Memory issues building multiple Angular apps with NX on bitbucket pipelines
- Yarn installation error on `create-nx-workspace` and Expo setup due to `peer dependencies are incorrectly met` HOT 3
- Cache not invalidated by previous targets (dependsOn)
- @nx/esbuild:esbuild with `"declaration": true` always executes from $PWD HOT 1
- nx/plugin e2e throws ENOENT out of the box
- Project are not affected when files from default namedInput are touched
- Incorrect serve command in README.md when initializing a fresh React (Remix) project
- Cannot prebuild Expo app with brand new nx monorepo because Gradle `expo-modules-core` HOT 3
- "An error occured while creating pruned lockfile" HOT 2
- Nx CLI is very slow when local plugins implement `createNodes` HOT 3
- [React] [Weback] Cannot run tasks after generated app with webpack and move to nx-enhance
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nx.