nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
23.28k stars 2.32k forks source link

Forwarding incompatible args to target dependencies breaks builds #8093

Closed kylecannon closed 2 years ago

kylecannon commented 2 years ago

Current Behavior

When running a command such as yarn nx build my-app --prod --no-progress --deploy-url=/dist/5.14.0-0/ --output-path=/my-path/ with buildable angular dependencies it will cause target builds to fail with messages such as:

nx run my-ng-lib:build --no-progress --deploy-url=/dist/5.14.0-0/ --output-path=/my-path/` 
'progress' is not found in schema

or

'deployUrl' is not found in schema
>  NX   ERROR  Running target "my-app:build" failed

  Failed tasks:

  - my-ng-lib:build

With this current issue, I believe it's impossible to use 13.3.0 to build production builds with custom deployment arguments.

Expected Behavior

Target dependencies should not receive invalid arguments.

Steps to Reproduce

This issue may not be prioritized if details are not provided to help us reproduce the issue.

Failure Logs

Environment

$ nx report

>  NX  Report complete - copy this into the issue template

  Node : 16.13.1
  OS   : darwin x64
  yarn : 1.22.17

  nx : 13.3.0
  @nrwl/angular : 13.3.0
  @nrwl/cli : 13.3.0
  @nrwl/cypress : 13.3.0
  @nrwl/devkit : 13.3.0
  @nrwl/eslint-plugin-nx : 13.3.0
  @nrwl/express : undefined
  @nrwl/jest : 13.3.0
  @nrwl/linter : 13.3.0
  @nrwl/nest : undefined
  @nrwl/next : undefined
  @nrwl/node : 13.3.0
  @nrwl/nx-cloud : undefined
  @nrwl/react : undefined
  @nrwl/react-native : undefined
  @nrwl/schematics : undefined
  @nrwl/tao : 13.3.0
  @nrwl/web : undefined
  @nrwl/workspace : 13.3.0
  @nrwl/storybook : 13.3.0
  @nrwl/gatsby : undefined
  typescript : 4.4.4
  rxjs : 7.4.0
  ---------------------------------------
  Community plugins:
     @angular/animations: 13.0.3
     @angular/cdk: 13.0.3
     @angular/common: 13.0.3
     @angular/compiler: 13.0.3
     @angular/core: 13.0.3
     @angular/forms: 13.0.3
     @angular/localize: 13.0.3
     @angular/material: 13.0.3
     @angular/platform-browser: 13.0.3
     @angular/platform-browser-dynamic: 13.0.3
     @angular/router: 13.0.3
     @angular/service-worker: 13.0.3
     @ngrx/component: 13.0.2
     @ngrx/component-store: 13.0.2
     @ngrx/effects: 13.0.2
     @ngrx/entity: 13.0.2
     @ngrx/router-store: 13.0.2
     @ngrx/store: 13.0.2
     @angular-devkit/build-angular: 13.0.4
     @angular/cli: 13.0.4
     @angular/compiler-cli: 13.0.3
     @angular/language-service: 13.0.3
     @ngrx/schematics: 13.0.2
     @ngrx/store-devtools: 13.0.2
     @nrwl/nx-plugin: 13.3.0
     ng-mocks: 12.5.0
dstoyanoff commented 2 years ago

I am experiencing the same problem right now. I have a test target that needs all dependencies built before running.

    "test": [
      {
        "target": "build",
        "projects": "dependencies"
      }
    ]

However, running nx test ui -u is forwarding the -ui argument down to the build target, which throws. Any advises how to solve?

I am using yarn workspaces for this project.

   Node : 16.13.2
   OS   : darwin arm64
   yarn : 1.22.15

   nx : 14.1.9
   @nrwl/angular : Not Found
   @nrwl/cypress : Not Found
   @nrwl/detox : Not Found
   @nrwl/devkit : 14.1.9
   @nrwl/eslint-plugin-nx : Not Found
   @nrwl/express : Not Found
   @nrwl/jest : 14.1.9
   @nrwl/js : 14.1.9
   @nrwl/linter : 14.1.9
   @nrwl/nest : Not Found
   @nrwl/next : Not Found
   @nrwl/node : Not Found
   @nrwl/nx-cloud : 14.0.5
   @nrwl/nx-plugin : Not Found
   @nrwl/react : Not Found
   @nrwl/react-native : Not Found
   @nrwl/schematics : Not Found
   @nrwl/storybook : Not Found
   @nrwl/web : Not Found
   @nrwl/workspace : 14.1.9
   typescript : 4.7.2
   ---------------------------------------
   Community plugins:
github-actions[bot] commented 1 year ago

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.