Shekar Tippur
Shekar Tippur

Reputation: 165

aws amplify react deployment throwing manifest syntax error

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

Upvotes: 3

Views: 928

Answers (1)

wenzf
wenzf

Reputation: 485

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

Upvotes: 3

Related Questions