Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ng build --watch does not work after adding a lib to the workspace #23291

Closed
1 of 15 tasks
rothsandro opened this issue Jun 3, 2022 · 4 comments · Fixed by #23302
Closed
1 of 15 tasks

ng build --watch does not work after adding a lib to the workspace #23291

rothsandro opened this issue Jun 3, 2022 · 4 comments · Fixed by #23302
Assignees
Labels
area: angular/cli freq1: low Only reported by a handful of users who observe it rarely severity5: regression type: bug/fix
Milestone

Comments

@rothsandro
Copy link

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • extract-i18n
  • run
  • config
  • help
  • version
  • doc

Is this a regression?

Yes, the previous version in which this bug was not present was: 13.3.7

Description

When creating an empty workspace and adding an application, the ng build --watch command works as expected. After adding a library to the workspace it does not work anymore. Running the command will throw the following error:

Error: Unknown argument: watch

🔬 Minimal Reproduction

  1. ng new watchdemo --create-application=false
  2. cd watchdemo
  3. ng generate app showcase
  4. Add --project=showcase to the build + watch scripts in package.json
  5. npm run build and npm run watch => works
  6. ng generate lib comp
  7. npm run build => works (builds the showcase app)
  8. npm run watch => Error: Unknown argument: watch

Repo Angular 14: https://github.com/rothsandro/repro-ng-cli-watch-14/
Repo Angular 13 (works): https://github.com/rothsandro/repro-ng-cli-watch-13/

🔥 Exception or Error

Error: Unknown argument: watch

🌍 Your Environment


Angular CLI: 14.0.0
Node: 16.13.0
Package Manager: npm 8.1.0 
OS: darwin arm64

Angular: 14.0.0
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1400.0
@angular-devkit/build-angular   14.0.0
@angular-devkit/core            14.0.0
@angular-devkit/schematics      14.0.0
@schematics/angular             14.0.0
ng-packagr                      14.0.0
rxjs                            7.5.5
typescript                      4.7.3

Anything else relevant?

@ngbot ngbot bot added this to the needsTriage milestone Jun 6, 2022
@alan-agius4 alan-agius4 self-assigned this Jun 6, 2022
@alan-agius4 alan-agius4 added the freq1: low Only reported by a handful of users who observe it rarely label Jun 6, 2022
@ngbot ngbot bot modified the milestones: needsTriage, Backlog Jun 6, 2022
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Jun 7, 2022
…termined

When the workspace has multiple projects and we the project to use cannot be determined from the current working directory, we now issue an actionable error message.

Closes angular#23291
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Jun 7, 2022
…termined

When the workspace has multiple projects and we the project to use cannot be determined from the current working directory, we now issue an actionable error message.

Closes angular#23291
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Jun 7, 2022
…termined

When the workspace has multiple projects and we the project to use cannot be determined from the current working directory, we now issue an actionable error message.

Closes angular#23291
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Jun 7, 2022
…termined

When the workspace has multiple projects and we the project to use cannot be determined from the current working directory, we now issue an actionable error message.

Closes angular#23291
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Jun 7, 2022
…termined

When the workspace has multiple projects and we the project to use cannot be determined from the current working directory, we now issue an actionable error message.

Closes angular#23291
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Jun 7, 2022
…termined

When the workspace has multiple projects and we the project to use cannot be determined from the current working directory, we now issue an actionable error message.

Closes angular#23291
@rothsandro
Copy link
Author

@alan-agius4 I already provide the project via --project argument (step 4).

@alan-agius4
Copy link
Collaborator

alan-agius4 commented Jun 7, 2022

Interesting, --project shouldn't be available since project should be provided as a position argument.

alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Jun 7, 2022
Yargs allows passing using positional arguments as flags. This we should handle this when retrieving the project.

Closes angular#23291
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Jun 7, 2022
Yargs allows passing using positional arguments as flags. This we should handle this when retrieving the project.

Closes angular#23291
@alan-agius4
Copy link
Collaborator

alan-agius4 commented Jun 7, 2022

Should be addressed via c9a2d4e

alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Jun 7, 2022
Yargs allows passing using positional arguments as flags. This we should handle this when retrieving the project.

Closes angular#23291
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Jun 7, 2022
Yargs allows passing using positional arguments as flags. This we should handle this when retrieving the project.

Closes angular#23291
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Jun 8, 2022
Yargs allows passing using positional arguments as flags. This we should handle this when retrieving the project.

Closes angular#23291
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Jun 8, 2022
Yargs allows passing using positional arguments as flags. This we should handle this when retrieving the project.

Closes angular#23291
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Jun 8, 2022
Yargs allows passing using positional arguments as flags. This we should handle this when retrieving the project.

Closes angular#23291
clydin pushed a commit that referenced this issue Jun 8, 2022
Yargs allows passing using positional arguments as flags. This we should handle this when retrieving the project.

Closes #23291

(cherry picked from commit f6e8ce2)
clydin pushed a commit that referenced this issue Jun 8, 2022
Yargs allows passing using positional arguments as flags. This we should handle this when retrieving the project.

Closes #23291
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jul 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: angular/cli freq1: low Only reported by a handful of users who observe it rarely severity5: regression type: bug/fix
Projects
None yet
3 participants