I'm trying to post a tweet and continually run into "TypeError: Load failed" without any explanation as to why the tweet will not post.
import { Client } from 'twitter-api-sdk';
const client = new Client(process.env.TWITTER_BEARER_TOKEN!);
interface PostTweetProps {
tweetBody: string;
}
export async function PostTweet({ tweetBody }: PostTweetProps) {
console.log(tweetBody), //successful logging
//breaks here
await client.tweets.createTweet({
text: tweetBody,
})
.catch((err) => console.log(err));
}
My PostTweet function is sound, and the console is outputting the text that is passed from my index.ts so there is no issue in the frontend, just running into the error when it goes to post.