Skip to content
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

weired tweet.user is undefined #144

Open
mawnir opened this issue Nov 20, 2023 · 0 comments
Open

weired tweet.user is undefined #144

mawnir opened this issue Nov 20, 2023 · 0 comments

Comments

@mawnir
Copy link

mawnir commented Nov 20, 2023

With this tweet id = '1716120243775402095' => "This Post is from an account that no longer exists"
I get this error: 'TypeError: tweet.user is undefined'

my code:

const { data, error, isLoading } = useSWR('/api/tweets/' + tweetId, fetcher);

    if (isLoading) {
        return (<TweetSkeleton />)
    }
    else if (error) {
        return null// (<TweetNotFound />)
    } else {
        //console.log(data.data);
        if (data.data) {
            const tweet = enrichTweet(data.data);  <== Problem here 

how can i check this before hand?

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

No branches or pull requests

1 participant