Skip to content

Not showing data from localStorage Angular App #146475

Answered by NoemiaGitHub
deky93 asked this question in Pages
Discussion options

You must be logged in to vote

Yes, this is a common issue when updating Angular applications on GitHub Pages. Here are some solutions that might help resolve the 404 error:

Update the base-href: Ensure that the base-href in your index.html file is set correctly. You can do this when building your project with the command:

ng build --prod --base-href "https://your-username.github.io/your-repository/"
This ensures that all relative paths are resolved correctly.

Add a 404.html file: Create a 404.html file in the root of your repository and copy the content of index.html into it. This helps redirect any not found URLs to the main page.

Check browser cache: Sometimes, the browser might be using a cached version of the file…

Replies: 2 comments 10 replies

Comment options

You must be logged in to vote
10 replies
@Chryistopher
Comment options

@NoemiaGitHub
Comment options

@Chryistopher
Comment options

@NoemiaGitHub
Comment options

@Chryistopher
Comment options

Answer selected by deky93
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working correctly Pages Host a static website, right from your repo
3 participants