Why is refreshing my Angular 6 project on S3/Cloudfront causing errors?

I am having an issue with my Angular 6 project hosted on an S3 bucket with Cloudfront. Every time I refresh, the project seems to be lost and I am redirected to a page that says: What could be causing this? When I refresh on my local server, I am simply logged out and redirected to the login page. I thought this might be a problem with my S3 bucket settings, so I uploaded to the project that I knew was configured correctly (I had an Angular 5 project in there that didn't have the refresh problem). But, the same thing happened so it seems it is something within my project.

Could it be how I compile the files? I am using 'ng build'

Any help is appreciated! Thanks so much.


5 Likes8.85 GEEK