-
-
Notifications
You must be signed in to change notification settings - Fork 585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Http failure during parsing for i18n/.en.json file #1406
Comments
It's most likely an issue with your json file. Can you post it? |
@CodeAndWeb It's a pretty big file with almost 4000 lines of translations :/ Also, we've checked the .json file many times and everything looks fine (no trailing commas, no single quotes where there should be double, correctly inserted colons and brackets...). What should we be on the lookout for? |
Ok. There are tools out there to check your json file - if it does not contain sensitive data you can for example paste it here: https://jsonlint.com Another option is that the file that is received is not json. E.g. the file does not exist and instead of the json a html page with the error message is received. I am a bit confused by the error message your are receiving. Its it really example.com? I had assumed that you replaced the domain name. It should usually contain something like "localhost:4200" ... See our tutorial here. |
We have done that and everything passed. No issues.
The path is correctly leading to the .json file.
:) No. It's not example.com. I replaced the domain, because I though it was irrelevant. Also didn't replace with 'localhost:4200' because issue is happening in production and not on localhost.
Everything in the app is implemented and working fine in terms of translations. We just get this error every now and then that, of course, interferes with our User Experience. And ultimately we're trying to figure out where this might be coming from seeing as the implementation seems solid. |
That file seems to be ok - and I can access it - except from Safari but this is because of my content blocker. When you get the error, you could open the browser dev tools and take a look at the requests. |
We can't really do that because the error isn't a consistent one and we haven't been able to reproduce it on our side - we receive the reports from errors that our users have while using our application. However, we believe that if it were something directly related to our implementation it would happen much more consistently than it does. Is this not an issue that's been highlighted or looked into previously? |
I'd assume that this is indeed not an issue with your app but your server. |
I'm having the same error happens randomly in the sentry error log tracking. My backup solution is refresh the page if detected such error. |
We are using ngx-translate with Angular V.13 and everything seems to be working well, the translations come through, but we sometimes are faced with the following error message:
"Http failure during parsing for https://example.com/i18n/en.json".
This error is not consistent and not easily reproducible.For context, we import the TranslateModule through:
and this is our factory:
There was a very similar issue here > ngx-translate/http-loader#37 < but never seemed to get a response, and is using a much older Angular version.
Any suggestion on how we can handle this?
The text was updated successfully, but these errors were encountered: