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
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
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
It should work as it does with cli version < 1.7.0
deployed dist continues to work, its only ng serve that is failing
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._
Most helpful comment
I had the same problem and could work around it by specifying --base-href:
ng serve --base-href /