Reputation: 165
I am having issues after deploying React application using AWS amplify. Couple of issues here:
I see that there was a reference to %PUBLIC_URL% in the public/index.html. In the documentation, it says %PUBLIC_URL% will get replaced with the URL of the public
folder during the build. It doesnt seem to be happening. Not sure what build means here.
I replaced %PUBLIC_URL% with /. I seem to be getting Manifest: Line: 1, column: 1, Syntax error.
I tried adding crossorigin="use-credentials"
as suggested in one of the forums, but that doesnt seem to have any effect.
I have sifted through reference to this error and none seem to be pointing to the solution.
Appreciate any pointers.
S
Upvotes: 3
Views: 928
Reputation: 485
I ran into the same issue. This worked for me:
Open Amplify console
'App settings' > 'Rewrites and redirects', click 'edit'
click 'Open text editor'
paste this:
[
{"source": "/manifest.json",
"target": "/manifest.json",
"status": "200",
"condition": null
},
{
"source": "</^((?!.(css|gif|ico|jpg|js|png|txt|svg|woff|ttf)$).)*$/>",
"target": "/index.html",
"status": "200",
"condition": null
}
]
Note: the redirect of the manifest MUST be before the index.html
Upvotes: 3