aws-amplify / amplify-hosting

AWS Amplify Hosting provides a Git-based workflow for deploying and hosting fullstack serverless web applications.
https://aws.amazon.com/amplify/hosting/
Apache License 2.0
460 stars 116 forks source link

This XML file does not appear to have any style information associated with it. #619

Closed karrettgelley closed 4 years ago

karrettgelley commented 4 years ago

Describe the bug When I reload a page in my dev or master environments (served with amplify console/S3) I get the following error: This XML file does not appear to have any style information associated with it.. To be specific, if I type in a url like masterenv.com/somepage, or reload the page at that point I get the error. In the dev console, the browser throws a 403 error on the page. However, if I navigate using the links in my app to the same page I do not get the error.

Expected behavior I should be able to reload a page with a specific url or type such a url into the browser without getting getting an error.

Screenshots Screen Shot 2020-04-24 at 5 52 52 PM

What is Configured? const awsmobile = { "aws_project_region": "us-west-2", "aws_cognito_identity_pool_id": "us-west-2:xxxxx, "aws_cognito_region": "us-west-2", "aws_user_pools_id": "us-west-xxx", "aws_user_pools_web_client_id": "4dlmqnsk1ol8g8suf0ifof9s85", "oauth": { "domain": "xxx.auth.us-west-2.amazoncognito.com", "scope": [ "phone", "email", "openid", "profile", "aws.cognito.signin.user.admin" ], "redirectSignIn": "https://dev.xxx.amplifyapp.com/,https://xxx.net/", "redirectSignOut": "https://dev.xxxx.amplifyapp.com/,https://xxx.net/", "responseType": "code" }, "federationTarget": "COGNITO_USER_POOLS", "aws_appsync_graphqlEndpoint": "https://xxx.appsync-api.us-west-2.amazonaws.com/graphql", "aws_appsync_region": "us-west-2", "aws_appsync_authenticationType": "AMAZON_COGNITO_USER_POOLS", "aws_user_files_s3_bucket": "amplifyxxx", "aws_user_files_s3_bucket_region": "us-west-2" };

Additional context To reiterate, I do not get this error in my local feature branch environment, but I do get the error on my dev and master environments which are hosted automatically by the amplify console. My app works as long as I dont refresh the page (and I'm not on the landing page) or type in a url in the browser with a subpath. It's very strange and Google is not very helpful. Hopefully someone has seen this before. I am using React with react-router and it doesn't seem to be a React thing. Please help :')

jordanranz commented 4 years ago

May be related to: https://github.com/aws-amplify/amplify-console/issues/591 or https://github.com/aws-amplify/amplify-console/issues/436

Moving to the Amplify Console repo for better exposure

karrettgelley commented 4 years ago

@jordanranz Worked like a charm! Thanks. For those who are wondering, I had to set up a rewrite in the amplify console that redirects all traffic to index.html for a spa.

gildniy commented 3 years ago

@karrettgelley your solution works for me

AyazAI commented 3 years ago

Yup it worked

github-actions[bot] commented 2 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.