Open flippidippi opened 1 year ago
@flippidippi I tried to push up a pr to throw an error, but I realized that the current logic will fall to the default configuration if the specified is not found. the reason is that a build sometimes depends on other libraries, whereas the specified configuration might be in its dependent libraries.
Then maybe we would need an option in project json for target for something like "don't allow unknown configurations" or something? You are right, we really only want this in our apps/deploys.
hey @flippidippi, adding this change is going to require some design changes on how we build out the task graph. @xiongemi gave it a shot, but we need to have a way to make this opt in for certain targets, like you mentioned.
Your scenario is a valid concern, so we'll think of a way to get this going without breaking a lot of other people who rely on this mechanism.
Came here looking for the same feature. Was very suprised when my nx affected --target:build --configuration:ci
ran every single build that was affected.
This issue has been automatically marked as stale because it hasn't had any activity for 6 months. Many things may have changed within this time. The issue may have already been fixed or it may not be relevant anymore. If at this point, this is still an issue, please respond with updated information. It will be closed in 21 days if no further activity occurs. Thanks for being a part of the Nx community! 🙏
Not stale.
Current Behavior
When running a project without an invalid configuration, no error is thrown and it reverts to the default configuration and continues.
This is an issue and especially when doing deployments. We recently moved an app to production but forgot to add the configuration in
project.json
and ended up deploying with the wrong env vars.Expected Behavior
When running an nx run command and specifying configuration, if the configuration doesn't exist, the process should throw.
GitHub Repo
https://github.com/nrwl/nx-examples
Steps to Reproduce
npm i
yarn
npx nx run products:build:asd
nx run products:build
and doesn't error even thoughtasd
is not a valid configurationNx Report
Failure Logs
No response
Operating System
Additional Information
No response