Reputation: 1870
just finished my angular app.
ng serve -o
works perfectly. ng build -- prod
works.
but getting a blank page after uploading to the server, no errors on console.
after uploading the app to my server, the index.html page shows in the browser, with title in the browser tab, background-color correct, even favicon shows up, but other than that the page is blank. It's like angular is not running.
page here:
any ideas?
Upvotes: 0
Views: 3109
Reputation: 1
Ok, this just happened to me and may help someone else:
installed @nestjs/ng-universal $ ng add @nestjs/ng-universal the angular project I´m working on already had @nguniversal installed, I´ve uninstalled manually all I´ve found related to it. so when I´ve installed this new package, it modified the again /src/main.ts, wrapping twice the boostrap.
document.addEventListener('DOMContentLoaded', () => {
document.addEventListener('DOMContentLoaded', () => {
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
});
});
This give me a blank page running $ ng serve with no error, no message, no nothing, just a white and nasty page. After deleting one of the document.addEventListener( ... wrappers, it worked!
Upvotes: 0
Reputation: 3730
If still your app is not working then try to add this in your index.html
file.
There will be this line <base href="/">
, just put dot before /
like this <base href="./">
.. and then try again.
Upvotes: 2
Reputation: 1922
I would try to verify that everything is uploaded properly. If your hosting company has a file explorer I would check there first.
From what I am seeing in the console when I go to the site, there's a lot of 404's.
Upvotes: 2