Skip to content
This repository has been archived by the owner on Apr 24, 2024. It is now read-only.

Random tweet button in example is broken #11

Closed
DaniGuardiola opened this issue Feb 24, 2021 · 4 comments
Closed

Random tweet button in example is broken #11

DaniGuardiola opened this issue Feb 24, 2021 · 4 comments

Comments

@DaniGuardiola
Copy link

DaniGuardiola commented Feb 24, 2021

The "Click here to get a random tweet" button is broken in the Next.js example.
gnome-shell-screenshot-VOILZ0

@transitive-bullshit
Copy link
Owner

@DaniGuardiola is this still broken for you?

It's working for me in prod https://react-static-tweets.vercel.app/

@DaniGuardiola
Copy link
Author

Yep, it's still broken locally for me, both when using yarn dev and yarn build && yarn start. Seems like the api call is returning a 404 (that HTML code is the default Next 404 page). Here's the curl:

curl 'http://localhost:3000/api/tweets' \
  -H 'Connection: keep-alive' \
  -H 'Pragma: no-cache' \
  -H 'Cache-Control: no-cache' \
  -H 'sec-ch-ua: "Google Chrome";v="89", "Chromium";v="89", ";Not A Brand";v="99"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36' \
  -H 'Accept: */*' \
  -H 'Sec-Fetch-Site: same-origin' \
  -H 'Sec-Fetch-Mode: cors' \
  -H 'Sec-Fetch-Dest: empty' \
  -H 'Referer: http://localhost:3000/' \
  -H 'Accept-Language: es-ES,es;q=0.9,en-US;q=0.8,en;q=0.7' \
  -H 'dnt: 1' \
  -H 'sec-gpc: 1' \
  --compressed

Weird :/

@transitive-bullshit
Copy link
Owner

Ahhh locally you need an environment variable in order to use the Twitter API.

I'm going to close this issue for now since it's working in production.

@DaniGuardiola
Copy link
Author

Ah, okay, gotcha. Maybe that could be briefly documented somewhere.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants