Search code examples
angularamazon-s3http-status-code-404amazon-cloudfrontweb-hosting

Error Handling in S3 bucket static hoisting and cloud front configuration


I have an angular application. I am hoisting it on the S3 bucket. I have specified the index and error document properly.

enter image description here

In the cloud front configurations, I have specified the error pages respectively.

enter image description here

My application is working error free, But I see the error printing in the browser console in production.

enter image description here

How do I resolve this ??? I am open to all solutions, Please guide me.


Solution

  • Add RouterModule.forRoot(routes, { useHash: true }) in the app-routing module file. This will display a # in the route in the browser but resolved your issue.