Coder Social home page Coder Social logo

CORS error about flagsmith-js-client HOT 9 CLOSED

cuongqle avatar cuongqle commented on July 2, 2024
CORS error

from flagsmith-js-client.

Comments (9)

dabeeeenster avatar dabeeeenster commented on July 2, 2024

Hi,

We would need more details on your integration. Can you confirm this is running against the hosted api at api.bullet-train.io?

Can you provide as much info as possible, including browser console logs etc?

from flagsmith-js-client.

cuongqle avatar cuongqle commented on July 2, 2024

Yes, my project is running against app.bullet-train.io

I am actually have not much information, but /identify endpoint seem does not get response, and i only able to see CORS error in the console. Seem /identify request has been rejected for that user, not too sure what exactly reason here?

Any provide is really appropriately!
Thanks/Cuong

from flagsmith-js-client.

dabeeeenster avatar dabeeeenster commented on July 2, 2024

We'd need to see explicit code and logs to be able to help I'm afraid.

from flagsmith-js-client.

cuongqle avatar cuongqle commented on July 2, 2024

Here are code what i have setup in my project, it written in typescript:

import bulletTrain from "bullet-train-client";

I have wrapped under my static method to catch exception from bullet to see what is exactly error has been throwed.

static identify(id) {
try {
bulletTrain.identify(id);
} catch (e) {
console.error('Error identifying: ', e); <==== this never reached
}
}

The above call send user Id, to ask bullet identify user, and if successed, user info (id / email) will be persisted into bullet.
But as far as i noticed, identify method has been rejected and the error catch never been reached,

I only noticed in console this error:
'https://api.bullet-train.io/api/v1/traits/' from origin 'https://mywebsite' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

Which more info you need, just let me know?

Thanks/Cuong

from flagsmith-js-client.

dabeeeenster avatar dabeeeenster commented on July 2, 2024

Does this happen every time you make the call?

from flagsmith-js-client.

cuongqle avatar cuongqle commented on July 2, 2024

Yes, it happen every time.

from flagsmith-js-client.

dabeeeenster avatar dabeeeenster commented on July 2, 2024

Are you able to email [email protected] with details of the Environment API key etc and ideally a small piece of code that can be run by itself that reproduces this?

from flagsmith-js-client.

kyle-ssg avatar kyle-ssg commented on July 2, 2024

Additionally to this, it would be worth checking what ID identify is being called with, it could be that unsafe url characters are causing this.

from flagsmith-js-client.

dabeeeenster avatar dabeeeenster commented on July 2, 2024

Are you able to find the request object in the Chrome developer tools network tab, then right click and copy as cURL, then try and run it as a cURL request. Does that work or fail?

from flagsmith-js-client.

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.