Thomas Segato
Thomas Segato

Reputation: 5225

manifest.json 404 (Not Found)

I have a react application that works fine locally. However after I deploy to Azure Web App I get following error in console:

https://xxx.azurewebsites.net/manifest.json 404 (Not Found)

I can see the purpose is when people install the app on a mobile, then REACT renders differently dependent on the devise. I can also see it is located in the index.html file:

<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />

As my app is a web site does this file has any effect? Can I just delete it or should I try to solve the error? And if yes how?

Upvotes: 12

Views: 21932

Answers (3)

Fahry Mohammed
Fahry Mohammed

Reputation: 659

For production apps, you have to target build for the public in firebase.json like the following:

{
  "hosting": {
    "public": "build", // Here you have to make changes.
    "ignore": [
     "firebase.json",
     "**/.*",
     "**/node_modules/**"
    ],
    "rewrites": [
     {
       "source": "**",
       "destination": "/index.html"
     }
    ],
    "headers": [
     {"source": "/service-worker.js", "headers": [{"key": "Cache-Control", "value": "no-cache"}]}
    ]
  }
}

Upvotes: 0

AMAL MOHAN N
AMAL MOHAN N

Reputation: 1632

have you tried this?

go to angular.json

add manifest.json location in assets

"assets": [
              "src/favicon.ico",
              "src/assets",
              "src/manifest.json"
          ],

my angular.json file

restart dev server using ng serve

Upvotes: -2

Max Schmitt
Max Schmitt

Reputation: 3152

Are you using create-react-app?

The manifest makes only sense when you want that your users can install your app so it works without an internet connection e.g. Thats in the end a Progressive Web App. So for you it's probably fine to just remove the line.

(under which path does your app serve? Maybe you have to specify a base path: https://create-react-app.dev/docs/deployment/#building-for-relative-paths

Upvotes: 6

Related Questions