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

Issue with having multiple --base-href option. (Data path “.baseHref” should be string.) #12948

Closed
chaitanyamullangi opened this issue Nov 13, 2018 · 7 comments · Fixed by #12976
Assignees
Labels
area: angular/cli freq1: low Only reported by a handful of users who observe it rarely severity5: regression
Milestone

Comments

@chaitanyamullangi
Copy link

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Command (mark with an x)

- [ ] new
- [x] build
- [x] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [x] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Versions

node -> v8.11.3
npm -> v5.5.1
ng -> v6.2.7

Repro steps

I have recently upgraded to Angular 6 from Angular 5. I am having Angular-cli@6.2.7
In my package.json, I have configured script "build": "ng build --prod --base-href=/my-ui/"
now when I run yarn build --base-href=/my-ui-2/. resulting following error

The log given by the failure

$ng build --prod --base-href=/my-ui/ --base-href=/my-ui-2/
Schema validation failed with the following errors:
  Data path ".baseHref" should be string.
error Command failed with exit code 1.

Desired functionality

It used to work in earlier versions of angular-cli considering the last option i.e my-ui-2.

Mention any other details that might be useful

@ngbot ngbot bot added this to the needsTriage milestone Nov 13, 2018
@alan-agius4 alan-agius4 added freq1: low Only reported by a handful of users who observe it rarely severity5: regression labels Nov 13, 2018
@alan-agius4
Copy link
Collaborator

Hi, I have looked at this and it seems that is no longer reproducible in version 7 of the CLI.

@clydin
Copy link
Member

clydin commented Nov 13, 2018

I think there is still an open concern here regarding the behavior in the case an option is specified two or more times. Should it error? Warn? Which of the options should be used? etc.

@clydin clydin reopened this Nov 13, 2018
@clydin clydin added the needs: discussion On the agenda for team meeting to determine next steps label Nov 13, 2018
@chaitanyamullangi
Copy link
Author

In the case an option is specified two or more times. In earlier versions it used to pick the last option. which is the expected as well.

@dominikg
Copy link

I reported a similar issue here: #11448
and agree with @mcshiva that the behavior (last value is used when an option is passed multiple times) is expected.

@clydin
Copy link
Member

clydin commented Nov 15, 2018

I think I’d still prefer some type of warning though. Depending on the setup, it may not be obvious that multiple values are being passed.

@hansl hansl self-assigned this Nov 15, 2018
@hansl hansl removed the needs: discussion On the agenda for team meeting to determine next steps label Nov 15, 2018
@hansl
Copy link
Contributor

hansl commented Nov 16, 2018

The latest v7 argument parser picks the last option. I think it was in the way yargs-parser was in v6. This issue is fixed. What remained is whether or not we should show some warning, and I think that's a generally good idea.

@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 Sep 8, 2019
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants