TwitterJSClient
TwitterJSClient copied to clipboard
No Access Control Allow Origin header
With the following steps:
I get this error:
This is per the example on your page. What is wrong?
+1
+1
Have the same issue.
+1 here. Anyone found a solution?
How are you running your code? If you're running it off disk from a compiled bundle (aka not from a server on http) this is the cause of the problem because it is a cross origin request. You can't change protocols going from file to http (twitter's url). If so, try running this with a simple python server first from the directory where your code is:
python -m SimpleHTTPServer 8080
then in your web browser navigate to:
localhost:8080
You should be able to pick your index.html and see your page
If not, then can you provide more info as to how you are running your code?
I’m working with react js and I’m using TwitterJSClient http://localhost:3000 I have the same issue @vardhan1990
I'm working with react js too http://localhost:8000 and I have the same issue @vardhan1990 @davinanaya
+1 Anyone found a solution?
Any solution yet?
+1
+1
+1
+1
+1
Did anyone find a solution yet? :)
+1
Well, I've fixed it (But I used Twit instead, because of the current one's bad documentation/structure).
What's happening? Twitter API don't allow us to get any data using a Client-Side Script, it has to be sent via Server-Side Script.
How to fix it?
You MUST use something like NodeJS to accomplish it, with the same code, it will work pefectly fine!
I've used CodeSandbox to show you a Live Preview (You can fork
it)
*Don't forget to replace the XXXX
with the actual values, then Refresh
, and you will see the results via the Terminal