angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Livereload is not affected by any available BaseURL-like settings

Open smnbbrv opened this issue 8 years ago • 10 comments

Versions

Angular CLI: 1.6.0
Node: 8.1.3
OS: darwin x64
Angular: 5.1.3
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cli: 1.6.0
@angular-devkit/build-optimizer: 0.0.36
@angular-devkit/core: 0.0.22
@angular-devkit/schematics: 0.0.42
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.0
@schematics/angular: 0.1.11
@schematics/schematics: 0.0.11
typescript: 2.4.2
webpack: 3.10.0

Repro steps

  • Look at the issue https://github.com/angular/angular-cli/issues/6932 that is merged / closed
  • Try all of the possible configuration settings to run the server
  • Try any of the start commands in the repo reproducing the issue https://github.com/smnbbrv/angular-cli-livereload-problem/blob/master/package.json :
    "start-base": "ng serve --base-href=/some-base-href/",
    "start-base-deploy": "ng serve --base-href=/some-base-href/ --deploy-url=/some-base-href/",
    "start-base-deploy-servepath": "ng serve --base-href=/some-base-href/ --deploy-url=/some-base-href/ --serve-path=/some-base-href/",

Observed behavior

Livereload paths are not affected by any of the settings:

http://localhost:4200/sockjs-node/info?t=1515528095046

Desired behavior

I have two apps; one of them is running on the default base url, another one has a specified base url. The second one is never getting refreshed. I want it to be refreshed :D

Mention any other details that might be useful (optional)

smnbbrv avatar Jan 09 '18 20:01 smnbbrv

Any updates to this? This seems to be causing the issues reported here: https://github.com/aspnet/JavaScriptServices/issues/1518

Vx2gas avatar May 08 '18 04:05 Vx2gas

Any updates? I need to serve several apps simultaneously and I can't figure out how to set up cli to work w/ my reverse proxy.

tplk avatar Aug 29 '18 12:08 tplk

I have similar needs. I tried adding the serve option publicHost but then the URL does not include the "sockjs-node" part (i.e.: "publicHost": "http://agriculture.local.wallonie.be/opw/sample/" --> GET http://agriculture.local.wallonie.be/opw/sample/info?t=xxx)

FabienDehopre avatar Sep 03 '18 13:09 FabienDehopre

Just using servePath works great for me. Using baseHref loads the site, but livereload didn't work (404 errors on the html/js/css). @angular/core: 7.0.0, @angular/cli: 7.0.5, node: 10.11.0

ng serve --servePath /some-base-href/

nbergqui avatar Nov 19 '18 18:11 nbergqui

It does not work on Angular 6. If I only use the --servePath option, the <base href=""> tag is not correctly set. And if I use both --servePath and --baseHref options I get a [WDS] Disconnected immediately.

Angular CLI: 6.2.6
Node: 10.13.0
OS: win32 x64
Angular: 6.1.10
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.8.6
@angular-devkit/build-angular      0.8.6
@angular-devkit/build-ng-packagr   0.8.6
@angular-devkit/build-optimizer    0.8.6
@angular-devkit/build-webpack      0.8.6
@angular-devkit/core               0.8.6
@angular-devkit/schematics         0.8.6
@angular/cdk                       6.4.7
@angular/cli                       6.2.6
@ngtools/json-schema               1.1.0
@ngtools/webpack                   6.2.6
@schematics/angular                0.8.6
@schematics/update                 0.8.6
ng-packagr                         4.4.0
rxjs                               6.3.3
typescript                         2.9.2
webpack                            4.22.0

FabienDehopre avatar Nov 20 '18 08:11 FabienDehopre

Is this still a problem? If so can someone provide a reproduction using recent versions of Angular and CLI please?

filipesilva avatar Oct 08 '19 16:10 filipesilva

@filipesilva yes, it still is an issue. I have submitted a reproduction and fix in #15883

micmro avatar Oct 19 '19 16:10 micmro

Any way to get it working in @angular/cli@6 ?

nandanctv avatar Nov 14 '19 07:11 nandanctv

Hi @nandanctv I have not tried it with 6 but https://github.com/micmro/angular-base-href-reload-socket-path-workaround#workaround would probably work with it too.

micmro avatar Nov 16 '19 15:11 micmro

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.