2

I am having issues after deploying React application using AWS amplify. Couple of issues here:

  1. 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.

  2. 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

Shekar Tippur
  • 155
  • 2
  • 11
  • Looks like I have a similar problem as this one - https://stackoverflow.com/questions/60884235/aws-amplify-manifest-json-and-env-json-loading-index-html. I have added redirect rule as prescribed. The error persists. – Shekar Tippur Nov 24 '21 at 19:26

1 Answers1

2

I ran into the same issue. This worked for me:

  1. Open Amplify console

  2. 'App settings' > 'Rewrites and redirects', click 'edit'

  3. click 'Open text editor'

  4. 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

wenzf
  • 337
  • 6
  • 14