Bug: Profile images 404 due to Twitter/X avatar URL suffix/hash changes
Nobody has claimed this yet.
- #223 by @highoncomputers — closed without merging
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- react, typescript
Research direction
No file or test is named. Start by locating the default avatar component and the code that consumes Twitter's syndication response, then reproduce the stale profile_image_url 404 described here. Done means past-tweet embeds continue displaying the account's latest avatar after Twitter rotates the asset.
Written by the indexing model from the issue text.
Description
Profile images 404 due to Twitter/X avatar URL suffix/hash changes
Note: This only affects past tweets. Tweets posted after an avatar update will use the new image and render correctly. Old tweets using the old
profile_image_urlwill never automatically update.
Description
When embedding tweets, profile images can return a 404 because the profile_image_url from Twitter’s syndication API points to a stale asset.
react-tweet currently renders the URL directly from the syndication response, so once the old asset is purged, the embed shows a broken avatar.
Example
// Old URL Being Returned (404s)
https://pbs.twimg.com/profile_images/xxxxxxxxxxxxxx/xxxxxxx_normal.jpg
// New URL **NOT** Being Returned (works)
https://pbs.twimg.com/profile_images/xxxxxxxxxxxxxx/xxxxxxx_400x400.jpg
Steps to Reproduce
- Pick a personal / non-gold-check account and embed one of its tweets using
react-tweet. - Confirm the profile image renders correctly.
- Upgrade the account to a verified business / gold-check account.
- After the gold check is applied, reload the embed.
- Observe that the old
profile_image_urlnow returns a 404 and the avatar is broken.
Expected Behavior
- Avatars should always render, even if Twitter rotates the asset hash or updates the profile image.
- The component should ensure the latest avatar is displayed for past tweets, not just the version at the time of posting.
Actual Behavior
- Avatar requests fail with 404 for old suffix/hash.
- The tweet embed shows a broken profile image.
- Using URL suffix manipulations would only load the avatar that existed when the tweet was posted, not the latest profile image.
Current Workaround / Fallback
Currently, we bypass this issue by overriding the default avatar component in react-tweet.
Our custom component (SafeProfileImage) renders the original profile image URL, and if it 404s, it falls back to a known working image for the account.
Limitations:
- Without a dynamic latest-avatar fetch, past tweets still risk pointing to stale images if the account updates its avatar again.
- Manual updates to the fallback image are currently required to ensure the latest avatar is displayed.
- Dominant language
- TypeScript
- Stars
- 1.9k
- Forks
- 119
- Avg merge
- 6m
- Merged PRs (30d)
- 1
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from vercel/react-tweet
-
`QuotedTweet.self_thread` is optional in syndication responsesPossibly taken @ocavue claimed this 21 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 88/100
vercel/react-tweet#225 ·
-
AbortError when playing video: "media was removed from the document"Possibly taken @ShobhanKarthish claimed this 36 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
vercel/react-tweet#213 ·
-
why entities is not iterable also it shows Cannot read properties of undefined (reading 'indices')Open
Difficulty 3/5 1-2 days Newbie friendliness 45/100
vercel/react-tweet#221 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
vercel/react-tweet#212 · 8 comments · 29 reactions ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
vercel/react-tweet#208 ·
All issues in vercel/react-tweet
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
homarr-labs/dashboard-icons#2939 ·
Maintainers usually reply within 1 day
-
Agent/category reasoning variants are still checked against the stale model cache in chat.paramsOpenopencode
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
code-yeongyu/oh-my-openagent#10003 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
Actions on ToastsOpen
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
nextcloud-libraries/nextcloud-dialogs#2669 ·
Maintainers usually reply within 1 day