You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
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
Activity
rychkog commentedon Mar 12, 2016
+1
tmnone commentedon Mar 14, 2016
+1
ZachLiuGIS commentedon Mar 22, 2016
Have the same issue.
lorenzosignoretti commentedon Apr 16, 2016
+1 here. Anyone found a solution?
davefedele commentedon Jun 7, 2016
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 commentedon Mar 24, 2017
I’m working with react js and I’m using TwitterJSClient
http://localhost:3000
I have the same issue @vardhan1990
flavalcode commentedon Jun 14, 2017
I'm working with react js too
http://localhost:8000
and I have the same issue @vardhan1990 @davinanaya
EranOV23 commentedon Aug 10, 2017
+1 Anyone found a solution?
iamsaksham commentedon Aug 24, 2017
Any solution yet?
MovsesMesropyan commentedon Dec 11, 2017
+1
nimaiwalsh commentedon Dec 14, 2017
+1
darvid7 commentedon Apr 1, 2018
+1
markcorrea commentedon May 7, 2018
+1
fclaussen commentedon Oct 19, 2018
+1
elharony commentedon Mar 2, 2019
Did anyone find a solution yet? :)
DmitryMironchenko commentedon Mar 5, 2019
+1
elharony commentedon Mar 8, 2019
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
forkit)*Don't forget to replace the
XXXXwith the actual values, thenRefresh, and you will see the results via theTerminal