Open gcherem opened 3 years ago
+1
Having the same issue.
It's not the problem of ngx-translate. Read: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
In short, remote server which holds translations should add header in response: Access-Control-Allow-Origin: *
Well the remote server is the angular web server. I have already enabled crossOrigin flag in angular builder and updated nginx config. Still cors issue with retrieving json from resource. Im suspecting this is linked to the Interceptor issue. I have several Angular FEs running and none of them have the issue except for the one with Interceptor enabled.
Im trying this now: https://github.com/ngx-translate/core/issues/921. will report back.
circumventing the HttpIntecptor fixed the issue for me. no more cors errors.
When getting translations from other server like this
I get the following cors error:
_Access to XMLHttpRequest at 'http://www.example.com/assets/i18n/en_US/translations.json' from origin 'null' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource._
Can anyone help with that? Thanks in advance.