Using Angular CLI's 'new' and 'build' results in stuck on "Loading..." -


created new project ng new test , ran ng build --prod. pushed dist folder github repo , enabled pages. resulting page seems stuck on "loading....". recreated using express sendfile index.html in dist , again angular2 app stuck on "loading..."

ng serve seems working fine , localhost:4200 results in "app works!" displaying.

is known bug , if so, how else can project built production?

you need set base href while generating dist folder.

try this

ng build --prod --base-href . 

p.s : don't forget dot @ end.then push it.

for express serve dist folder, please follow following gist gist.github.com/parthghiya/eb337e2ee63ce8785d714e251b7ef0b8


Comments

Popular posts from this blog

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -