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 e2e does not respect host setting in angular.json #14151

Closed
krotscheck opened this issue Apr 12, 2019 · 3 comments · Fixed by #14165
Closed

ng e2e does not respect host setting in angular.json #14151

krotscheck opened this issue Apr 12, 2019 · 3 comments · Fixed by #14165
Labels
Milestone

Comments

@krotscheck
Copy link

🐞 Bug report

Command (mark with an x)

- [ x ] serve
- [ x ] e2e

Is this a regression?

I don't know.

Description

When executing ng e2e, the host parameter in the serve block is ignored.

🔬 Minimal Reproduction

$ ng init yourapp
$ nano angular.json  # add "host": "localhost.local" to serve configuration 
$ sudo sh -c 'echo "127.0.0.1   localhost.local" >> /etc/hosts'
$ ng serve
** Angular Live Development Server is listening on localhost.local:4200, ...

$ ng e2e
** Angular Live Development Server is listening on localhost:4200, ...

angular.json serve block should be:

        "serve": {
          "builder": "@angular-devkit/build-angular:dev-server",
          "options": {
            "browserTarget": "yourapp:build",
            "host": "localhost.local"
          },
          "configurations": {
            "production": {
              "browserTarget": "yourapp:build:production"
            }
          }
        },

Note that passing baseUrl throws an exception.

ng e2e --baseUrl="http://localhost.local:4200"
The 'baseUrl' option cannot be used with 'devServerTarget'.
When present, 'devServerTarget' will be used to automatically setup 'baseUrl' for Protractor.

🌍 Your Environment



     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 7.3.8
Node: 8.11.1
OS: darwin x64
Angular: 7.2.12
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.13.8
@angular-devkit/build-angular     0.13.8
@angular-devkit/build-optimizer   0.13.8
@angular-devkit/build-webpack     0.13.8
@angular-devkit/core              7.3.8
@angular-devkit/schematics        7.3.8
@angular/cli                      7.3.8
@ngtools/webpack                  7.3.8
@schematics/angular               7.3.8
@schematics/update                0.13.8
rxjs                              6.3.3
typescript                        3.2.4
webpack                           4.29.0
@alan-agius4 alan-agius4 added area: @angular-devkit/build-angular freq1: low Only reported by a handful of users who observe it rarely severity3: broken labels Apr 15, 2019
@ngbot ngbot bot added this to the needsTriage milestone Apr 15, 2019
@ngbot ngbot bot modified the milestones: needsTriage, Backlog Apr 15, 2019
@alan-agius4
Copy link
Collaborator

Hi krotscheck, thanks for reporting this.

There seems to be a bug where the host is not being respected. However, the exception is indeed correct as baseUrl should not be used in conjunction with the devserver.

@krotscheck
Copy link
Author

Well, I was pointing that out more as a "Here's a workaround I tried" bit.

alexeagle pushed a commit that referenced this issue May 7, 2019
alexeagle pushed a commit that referenced this issue May 7, 2019
@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 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants