Angular-cli: ng serve reloads fail with cli 1.7.0 beta

Created on 19 Jan 2018  路  6Comments  路  Source: angular/angular-cli

Versions

Angular CLI: 1.7.0-beta.1
Node: 9.4.0
OS: win32 x64
Angular: 6.0.0-beta.0
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

@angular/cli: 1.7.0-beta.1
@ngtools/json-schema: 1.1.0
typescript: 2.6.2
webpack: 3.10.0

Repro steps

create app with routing
ng serve, load home page, navigate away from home url
reload page in browser - or make edit and save for auto releoad

Observed behavior

Load fails as it tries to load everything from wrong path (... below represents path that was navigated to)
GET http://localhost:4200/.../inline.bundle.js net::ERR_ABORTED
GET http://localhost:4200/.../polyfills.bundle.js net::ERR_ABORTED
GET http://localhost:4200/.../styles.bundle.js net::ERR_ABORTED
GET http://localhost:4200/.../vendor.bundle.js net::ERR_ABORTED
GET http://localhost:4200/.../main.bundle.js net::ERR_ABORTED

Desired behavior

It should work as it does with cli version < 1.7.0

Mention any other details that might be useful (optional)

deployed dist continues to work, its only ng serve that is failing

Most helpful comment

I had the same problem and could work around it by specifying --base-href: ng serve --base-href /

All 6 comments

I had the same problem and could work around it by specifying --base-href: ng serve --base-href /

ng serve --base-href / workaround mostly works but I am still seeing 404's for font files

I also noticed this, looking forward to a fix, because 1.7.0 is definitely better performing than 1.6 :)

Same with 1.7.0-beta.2

Same with 1.7.0-beta-1. Looks like on reload, the path is not being rewritten to the root /.

As a temp work-around, I've used:
window.history.pushState({}, 'home', '/');

I've put this in my main.ts, at the top.

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._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jbeckton picture jbeckton  路  3Comments

IngvarKofoed picture IngvarKofoed  路  3Comments

brtnshrdr picture brtnshrdr  路  3Comments

gotschmarcel picture gotschmarcel  路  3Comments

rajjejosefsson picture rajjejosefsson  路  3Comments