Closed wamujlb closed 4 years ago
Please verify your url again... In your screenshot the request is red What happens if you insert the url directly in the browser?
It loads URL correctly and I see the result
Sorry, can't help without more info... (failed)net::ERR_FAILED is a networking error
Right now I set
requestOptions: { method: 'GET', mode: 'no-cors' }
Now I see success but no data is loaded.
Sorry, can't help without a reproducable example. Maybe your cors configuration is not correct
Where can I configure CORS for the request?
CORS are configured on server side
check the console tab, there you will see the browser error, if there is a cors issue
@adrai there is no error right now. Could you please give me an example how to load translation from any Public URL?
Take this example: https://github.com/i18next/i18next-http-backend/blob/master/example/node/app.js change the loadPath with: https://api.locize.app/8166472e-7ac6-44e5-a53f-96a6ca165e2b/latest/{{lng}}/{{ns}} replace t('welcome') with t('localized')
maybe @hyprstack had a similar issue with s3?
Trying to solve it, but have no idea what is happening. My AWS configuration seems fine
Trying to solve it, but have no idea what is happening. My AWS configuration seems fine
Then try to do a simple fetch to your s3 bucket...
fetch('url to your json file')
@adrai thank you for your help. Added CORS configuration in AWS. We can close this issue
If you like this module donβt forget to star this repo. Make a tweet, share the word or have a look at our https://locize.com to support the devs of this project.
There are many ways to help this project π
Have you tried adding the lng
and ns
arguments to your loadPath method? I noticed you don't have them in the function definition.
loadPath(lng, ns) { return '<S3_BUCKET>.eu-central-1.amazonaws.com/{{lng}}/{{ns}}.json'; },
Have you tried adding the
lng
andns
arguments to your loadPath method?
Yes, it's used in the tests... => https://github.com/i18next/i18next-http-backend/blob/master/test/http.spec.js#L96
I noticed you don't have them in the function definition.
should be this: ((lngs: string[], namespaces: string[]) => string)
=> https://github.com/i18next/i18next-http-backend/blob/master/index.d.ts#L3
π Bug Report
Hi. I'm trying to load translation file from public URL but I get
(failed)net::ERR_FAILED
. URL is correct and I can open it from my browser.To Reproduce
Here is my config file:
Expected behavior
Should load translation file
Your Environment