Hi,
When running the report I get the following error:
"ERROR: file isn't valid JSON: SyntaxError: Unexpected token  in JSON at position 0"
It's been driving me mental for weeks! Turns out it's because the manifest.json was saved with a byte-order-mark (I'm on Windows). Saved without the BOM and all works well.
May I suggest adding a warning to the documentation so others don't have a similar battle?
Many thanks,
Franz.
As far as I can tell LH is using the standard JSON.parse method.
Might be worth looking into https://github.com/sindresorhus/strip-bom/blob/master/index.js
Not sure what the correct thing to do here is. A BOM is an invalid character in JSON, but in some cases clients will drop the BOM before attempting to parse.
At the very least we could warn that the first character is a BOM to give a better error message, though.
If I test (on a non-Windows machine) a manifest saved with a BOM, the application panel in devtools lists no information for the manifest. Since IIUC devtools is exposing what Chrome has actually parsed from the manifest, this implies Chrome doesn't understand the manifest either (devtools does not report a JSON SyntaxError, though, or any error at all).
If the browser doesn't understand it, we should definitely mark it as an error, just with a better error message.
OTOH, (one of?) the native Chrome JSON parser(s) explicitly skips BOMs when encountered. Not sure how that interacts with the manifest parser.
HI @brendankenny,
To confirm when I was saving with BOM I didn't see the manifest parameters in DevTools. They magically start appearing when saved without BOM - which is in line with what you're seeing.
If it's not feasible to raise an error, perhaps a warning that _always_ appears in the report would be sufficient? I'm just conscious of others falling into the same issue.
If I can be of any assistance, please give me a shout.
IMO, we shouldn't do something special. It's an error in the parser so Chrome will not load it as I understand it.
@toepoke when you look at the manifest panel in devtools, do you see warnings or errors?

also same question for @zmandel, as it seems like a related issue.
on devtools there are no warnings or errors. my wpa has been also working
fine (offline etc) with a "utf-8 with signature" manifest. only changed it
to non-signature because of this lighthouse issue.
On Fri, Mar 3, 2017, 1:50 PM Paul Irish notifications@github.com wrote:
@toepoke https://github.com/toepoke when you look at the manifest panel
in devtools, do you see warnings or errors?
[image: image]
https://cloud.githubusercontent.com/assets/39191/23564521/1da6a2a2-ffff-11e6-89ac-42c28e374f44.pngalso same question for @zmandel https://github.com/zmandel, as it seems
like a related issue.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/GoogleChrome/lighthouse/issues/1702#issuecomment-284037840,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AEKdJ5PWEhGZLgapxciS76sP3ZWSbSbVks5riGD5gaJpZM4L-dPz
.
HI @paulirish ,
Nothing appears in the console. The manifest is devtools is just blank when saved with BOM:
Hope this helps.
Error state:

Working state:

perhaps it's more like a chrome issue where it should tell that it's invalid.
There is an open issue for the dev tools where i added the comment that there should be an info text (would have saved us a few debug hours :-)
@HolgerJeromin thank you for reporting to devtools.
I'll update lighthouse to check <0xEF 0xBB 0xBF> as first bytes to show a better error message
Fixed on master
Most helpful comment
There is an open issue for the dev tools where i added the comment that there should be an info text (would have saved us a few debug hours :-)