-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
links to tweets whose author limited who can view them crashes builds #99
Comments
As always - I'm happy to provide PR (once I get some time :) ) |
@pieh I'm happy to accept a PR if you have time to figure this one out 🙂 |
@all-contributors Please add @pieh for bug |
I've put up a pull request to add @pieh! 🎉 |
The problem here is that we use So either we have to change |
🎉 This issue has been resolved in version 1.14.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
gatsby-remark-embedder
version:1.12.0
node
version:10.16.3
npm
(oryarn
) version:yarn@1.17.3
Relevant code or config
In gatsby-config (from reproduction site repository linked below)
What you did:
Author of tweet I had link for limited who can see their tweets - for example https://twitter.com/mattconvente/status/1099706762897342465
What happened:
Got following error when trying to build site:
Reproduction repository:
https://github.com/pieh/limited-tweets-repro
Problem description:
The error description (
Cannot read property 'replace' of undefined
) was not very helpfulSuggested solution:
Add some error checking and throw nicer error. In this instance error orignated from this expression -
gatsby-remark-embedder/src/transformers/Twitter.js
Line 27 in dc3e07c
which tried to use
.replace
onundefined
Response from twtiter oembed ( https://publish.twitter.com/oembed?url=https://twitter.com/mattconvente/status/1099706762897342465&dnt=true&omit_script=true ) looks like this:
It also report 403 status which I guess is not checked anywhere and is assumed. everything goes as planned.
Not sure if this should be twtitter specific check or
fetchOEmbedData
utility should check status and throw if it's not200
? Doing this only infetchOEmbedData
would only have url for oembed which might not give enough information, so probably combination of throwing in that utility + catching in twitter transformer and showing problematic tweet url might be most robust as it would handle twitter related issues and also would have some handling for other providers?The text was updated successfully, but these errors were encountered: