Giter VIP home page Giter VIP logo

Comments (18)

adrai avatar adrai commented on May 25, 2024 1

btw: regarding s3 cors => https://docs.aws.amazon.com/AmazonS3/latest/user-guide/add-cors-configuration.html#:~:text=To%20add%20a%20CORS%20configuration,and%20then%20choose%20CORS%20configuration.
https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html#how-do-i-enable-cors

from i18next-http-backend.

adrai avatar adrai commented on May 25, 2024

Please verify your url again...
In your screenshot the request is red
What happens if you insert the url directly in the browser?

from i18next-http-backend.

wamujlb avatar wamujlb commented on May 25, 2024

It loads URL correctly and I see the result

from i18next-http-backend.

adrai avatar adrai commented on May 25, 2024

Sorry, can't help without more info...
(failed)net::ERR_FAILED is a networking error

from i18next-http-backend.

wamujlb avatar wamujlb commented on May 25, 2024

Right now I set
requestOptions: { method: 'GET', mode: 'no-cors' }
Now I see success but no data is loaded.

Screenshot 2020-10-06 at 16 35 54

from i18next-http-backend.

adrai avatar adrai commented on May 25, 2024

Sorry, can't help without a reproducable example.
Maybe your cors configuration is not correct

from i18next-http-backend.

wamujlb avatar wamujlb commented on May 25, 2024

Where can I configure CORS for the request?

from i18next-http-backend.

adrai avatar adrai commented on May 25, 2024

CORS are configured on server side

from i18next-http-backend.

adrai avatar adrai commented on May 25, 2024

check the console tab, there you will see the browser error, if there is a cors issue

from i18next-http-backend.

wamujlb avatar wamujlb commented on May 25, 2024

@adrai there is no error right now. Could you please give me an example how to load translation from any Public URL?

from i18next-http-backend.

adrai avatar adrai commented on May 25, 2024

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')

from i18next-http-backend.

adrai avatar adrai commented on May 25, 2024

maybe @hyprstack had a similar issue with s3?

from i18next-http-backend.

wamujlb avatar wamujlb commented on May 25, 2024

Trying to solve it, but have no idea what is happening. My AWS configuration seems fine

from i18next-http-backend.

adrai avatar adrai commented on May 25, 2024

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')

from i18next-http-backend.

wamujlb avatar wamujlb commented on May 25, 2024

@adrai thank you for your help. Added CORS configuration in AWS. We can close this issue

from i18next-http-backend.

adrai avatar adrai commented on May 25, 2024

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 πŸ™

from i18next-http-backend.

hyprstack avatar hyprstack commented on May 25, 2024

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'; },

from i18next-http-backend.

adrai avatar adrai commented on May 25, 2024

Have you tried adding the lng and ns 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

from i18next-http-backend.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.