We are encountering with fetching language files from Crowdin on the Windows platform. On macOS, iOS, and Android, everything works fine, and we receive the correct JSON data. However, on Windows, we are facing problems.
We can successfully fetch data for the manifest file and receive valid JSON from the following
The issue arises when trying to get data for any language file. For example, using the following
We are not receiving valid JSON on the Windows platform. And Json.Parse through error -
ERROR: Uncaught SyntaxError: Unexpected token in JSON at position 0, location: undefined:0:0
STACK:
[0]xhr.onload@assets/main/index.16a57.js:607
Could you please check if everything is correct on the Windows platform? This issue might be related to cross-platform compatibility. We are testing with Cocos Creator, and the code snippet we are using is as follows:
Thanks for your details. I see that our support team is already having a conversation with you via email, and they are checking all the details right now.
We will keep you updated and email just once we have a solution on the matter.
The issue was that the server is sending compressed responses (gzip deflate), which were not correctly handled by the XMLHttpRequest.
This caused the JSON parsing error. By default, the browser handles this decompression, but it seems that explicit handling is required when using XMLHttpRequest.