nrwl / nx

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

Nx build with --base-href does not run the specified project but the default project #22881

Closed aikrez closed 3 months ago

aikrez commented 4 months ago

Current Behavior

-project argument is ignored using --base-href

Expected Behavior

Nx build should be executed with --base-href for the specified project, not the default project

GitHub Repo

No response

Steps to Reproduce

  1. nx build --prod --project=my-ap --base-href=/path/

Nx Report

NX   Report complete - copy this into the issue template

Node   : 20.11.0
OS     : win32-x64
yarn   : 1.22.19

nx                 : 18.2.4
@nx/js             : 18.2.4
@nx/jest           : 18.2.4
@nx/linter         : 18.2.4
@nx/eslint         : 18.2.4
@nx/workspace      : 18.2.4
@nx/angular        : 18.2.4
@nx/cypress        : 18.2.4
@nx/devkit         : 18.2.4
@nx/eslint-plugin  : 18.2.4
@nx/node           : 18.2.4
@nx/plugin         : 18.2.4
@nx/storybook      : 18.2.4
@nrwl/tao          : 18.2.4
@nx/web            : 18.2.4
@nx/webpack        : 18.2.4
typescript         : 5.4.5
---------------------------------------
Community plugins:
@ng-bootstrap/ng-bootstrap : 14.1.1
@ngrx/component-store      : 17.2.0
@ngrx/effects              : 17.2.0
@ngrx/router-store         : 17.2.0
@ngrx/schematics           : 17.2.0
@ngrx/store                : 17.2.0
@ngrx/store-devtools       : 17.2.0
@storybook/angular         : 8.0.8

Failure Logs

$ nx build --prod --project=my-app --base-href=/path/

> nx run default-app:production --base-href=path/

so default app is run instead of my-app

Package Manager Version

No response

Operating System

Additional Information

Workaround (or correct way) is to add baseHref in project.json

AgentEnder commented 3 months ago

That command syntax isn't one of the two supported ways to run a target on a single project.

It should be one of:

aikrez commented 3 months ago

As in not supported but used to work for a couple of years :)

github-actions[bot] commented 2 months 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.