InfinityFree does not support .json files

[### Website URL] (https://joeborg.42web.io)

(https://joeborg.42web.io/pwa/)

Manifest: Line: 1, column: 1, Syntax error.

(please share the FULL error message you see, if applicable)

I developed a Progressive Web App (PWA) on my localhost, and it worked fine. However, when I uploaded it to InfinityFree, I encountered an error in the console: “Manifest: Line: 1, column: 1, Syntax error.” I validated the manifest.json file using the ‘Manifest Validator using CSV & JSON,’ and no errors were detected. The issue might be that InfinityFree does not automatically serve JSON files with the correct MIME type. This could cause the browser to fail to recognize the file as a valid web app manifest, resulting in the errors I’m seeing.
Thank you

The MIME type detection on our hosting is just fine, and if you try to open the file manually, you’ll see that the server responds with the right Content-Type header.

However, you’ll notice it doesn’t work outside of your browser. Specifically, because of this security system:

Unfortunately, the consequence of this is that it’s not possible to host a PWA with us.


Small side note, without considering the above, your manifest.json is invalid. You have a comment in your file for the theme_color, however JSON does not support comments. Some parsers will handle Javascript style comments in JSON like you’d expect in Javascript, but it’s still technically invalid JSOn.

4 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.