3

I have a manifest.json according to the MDN spec and while it works correctly when browsing the website from a mobile device (add to homescreen popup shows up, theme color and icons load...etc) Chrome Dev Tools is unable to parse it. The same problem persists on Lighthouse (chrome extension).

Chrome Dev Tools unable to parse manifest.json

Has anyone seen a similar issue? I would think that the JSON is invalid however copy-pasting into Web App Validator it is marked correct, but when inputting the URL it giving a parse error:

File isn't valid JSON: SyntaxError: Unexpected token in JSON at position 0

1 Answer 1

6

It is probably a BOM character issue in the manifest.json file.

If you have Notepad++ on your machine, try open the file, click menu "Encoding" -> "Encode in UTF8 without BOM" and then save the file.

If you don't have Notepad++, search Google for "Remove BOM character" for your favorite IDE/editor.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.