javascript - Invalid JSON syntax in progressive web app manifest.json file - Stack Overflow

I get the following error when using the Google Lighthouse extension or other similar manifest.json val

I get the following error when using the Google Lighthouse extension or other similar manifest.json validation services.

"ERROR: file isn't valid JSON: SyntaxError: Unexpected token in JSON at position 0"

The manifest works. I get the "Add to homescreen" prompt and the manifest.json file is found in dev tools (Application / Manifest section) though the parameters of the file aren't shown.

I've checked the format against the Google IO and that the MIME type is correct. I'm lost as to what else to try.

Any ideas?

I get the following error when using the Google Lighthouse extension or other similar manifest.json validation services.

"ERROR: file isn't valid JSON: SyntaxError: Unexpected token in JSON at position 0"

The manifest works. I get the "Add to homescreen" prompt and the manifest.json file is found in dev tools (Application / Manifest section) though the parameters of the file aren't shown.

I've checked the format against the Google IO and that the MIME type is correct. I'm lost as to what else to try.

Any ideas?

Share Improve this question edited Aug 23, 2019 at 11:07 toepoke.co.uk asked Feb 12, 2017 at 11:28 toepoke.co.uktoepoke.co.uk 8271 gold badge7 silver badges19 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 12

If you're on Windows the above error may be because you have the manifest.json file saved with a Byte Order Mark (BOM).

Saving without a BOM may fix the problem.

In Visual Studio use Save As, use the dropdown next to Save to select Save with Encoding, then pick Unicode (UTF-8 without signature).

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744330699a4568871.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信