BoyCook / TwitterJSClient

Twitter client written in JavaScript packaged as a node module
GNU General Public License v2.0
562 stars 176 forks source link

No Access Control Allow Origin header #36

Open vardhan1990 opened 8 years ago

vardhan1990 commented 8 years ago

With the following steps: image

I get this error: image

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

rychkog commented 8 years ago

+1

tmnone commented 8 years ago

+1

ZachLiuGIS commented 8 years ago

Have the same issue.

lorenzosignoretti commented 8 years ago

+1 here. Anyone found a solution?

davefedele commented 8 years ago

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?

davinanaya commented 7 years ago

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

valloneflavio commented 7 years ago

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

EranOV23 commented 7 years ago

+1 Anyone found a solution?

iamsaksham commented 7 years ago

Any solution yet?

MovsesMesropyan commented 6 years ago

+1

nimaiwalsh commented 6 years ago

+1

darvid7 commented 6 years ago

+1

markcorrea commented 6 years ago

+1

fclaussen commented 5 years ago

+1

elharony commented 5 years ago

Did anyone find a solution yet? :)

DmitryMironchenko commented 5 years ago

+1

elharony commented 5 years ago

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