TwitterJSClient icon indicating copy to clipboard operation
TwitterJSClient copied to clipboard

No Access Control Allow Origin header

Open vardhan1990 opened this issue 8 years ago • 17 comments

With the following steps: image

I get this error: image

This is per the example on your page. What is wrong?

vardhan1990 avatar Feb 29 '16 07:02 vardhan1990

+1

rychkog avatar Mar 12 '16 07:03 rychkog

+1

tmnone avatar Mar 14 '16 14:03 tmnone

Have the same issue.

ZachLiuGIS avatar Mar 22 '16 00:03 ZachLiuGIS

+1 here. Anyone found a solution?

lorenzosignoretti avatar Apr 16 '16 17:04 lorenzosignoretti

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?

davefedele avatar Jun 07 '16 06:06 davefedele

I’m working with react js and I’m using TwitterJSClient http://localhost:3000 I have the same issue @vardhan1990

davinanaya avatar Mar 24 '17 21:03 davinanaya

I'm working with react js too http://localhost:8000 and I have the same issue @vardhan1990 @davinanaya

valloneflavio avatar Jun 14 '17 19:06 valloneflavio

+1 Anyone found a solution?

EranOV23 avatar Aug 10 '17 21:08 EranOV23

Any solution yet?

iamsaksham avatar Aug 24 '17 08:08 iamsaksham

+1

MovsesMesropyan avatar Dec 11 '17 12:12 MovsesMesropyan

+1

nimaiwalsh avatar Dec 14 '17 07:12 nimaiwalsh

+1

darvid7 avatar Apr 01 '18 15:04 darvid7

+1

markcorrea avatar May 07 '18 20:05 markcorrea

+1

fclaussen avatar Oct 19 '18 18:10 fclaussen

Did anyone find a solution yet? :)

elharony avatar Mar 02 '19 16:03 elharony

+1

DmitryMironchenko avatar Mar 05 '19 09:03 DmitryMironchenko

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

elharony avatar Mar 08 '19 18:03 elharony