Home > Blockchain >  Missing manifest.json file in angular 12
Missing manifest.json file in angular 12

Time:11-22

I have created an angular application when i start it using ng serve and check it in browser i'm getting this error in console:

GET http://localhost:4200/manifest.json 404 (Not Found) manifest.json:1 Manifest: Line: 1, column: 1, Syntax error.

I searched in the project directory but couldn't found this manifest.json file.

This is the screenshot of console of web browser

enter image description here

Project Structure:

enter image description here

Any solution to resolve this issue

Thanks

CodePudding user response:

By default, when you create a new project, Angular doesn't create the manifest.json file.

It looks like from some part of your project you're trying to request the file, but since it's not in your project it cannot find it and throws you the error.

Try to check if your src/index.html has something like:

<link rel="manifest" href="manifest.json">

You can remove it to suppress the error. But if you really need to turn your app into PWA, then it's recommended to use the @angular/pwa package:

ng add @angular/pwa

It will do all the job for you and will initialize the manifest file.

  • Related