---
title: "Comment by Neutron on \"Build Your Own Personal Twitter Agent 🧠🐦⛓ with LangChain\" | Hashnode"
description: "On clicking &#39;Generate New Ideas&#39; it shows a pop up TypeError: Cannot read properties of undefined (reading &#39;instructions&#39;) In MainPage.tsx on aw"
url: "https://hashnode.com/posts/build-your-own-personal-twitter-agent-with-langchain/649c29c04c5b78227c6b5bed/comment/649e861d2a0936ab01ee1e13"
---

[Discussion](https://hashnode.com/posts/build-your-own-personal-twitter-agent-with-langchain/649c29c04c5b78227c6b5bed)

Comment [Build Your Own Personal Twitter Agent 🧠🐦⛓ with LangChain](https://hashnode.com/posts/build-your-own-personal-twitter-agent-with-langchain/649c29c04c5b78227c6b5bed)

[Neutron](https://hashnode.com/@Neutron768)

[Jun 30, 2023](https://hashnode.com/posts/build-your-own-personal-twitter-agent-with-langchain/649c29c04c5b78227c6b5bed/comment/649e861d2a0936ab01ee1e13)

On clicking 'Generate New Ideas' it shows a pop up `TypeError: Cannot read properties of undefined (reading 'instructions')`

In MainPage.tsx on `await generateNewIdeas()` it shows the following error :

`Expected 1 arguments, but got 0.ts(2554) types.ts(7, 6): Arguments for the rest parameter 'args' were not provided`

How do I resolve this? btw great blog and gg till now!

[Vince Canger](https://hashnode.com/@vincanger)

[Jun 30, 2023](https://hashnode.com/posts/build-your-own-personal-twitter-agent-with-langchain/649c29c04c5b78227c6b5bed/comment/649e861d2a0936ab01ee1e13#reply-649e87765b8c3caad1787fef)

you're not providing the correct arguments to `generateNewIdeas()`

[Neutron](https://hashnode.com/@Neutron768)

[Jun 30, 2023](https://hashnode.com/posts/build-your-own-personal-twitter-agent-with-langchain/649c29c04c5b78227c6b5bed/comment/649e861d2a0936ab01ee1e13#reply-649e8b452a0936ab01ee1f0d)

[Vince Canger](https://hashnode.com/@vincanger) any possible reasons as to why that might be occuring?

[Vince Canger](https://hashnode.com/@vincanger)

[Jun 30, 2023](https://hashnode.com/posts/build-your-own-personal-twitter-agent-with-langchain/649c29c04c5b78227c6b5bed/comment/649e861d2a0936ab01ee1e13#reply-649e8dcd5b8c3caad1788136)

hmm it seems like its actually an issue with the `rettiwt-api` twitter scraper. I've submitted an issue to the library's author here: [github.com/Rishikant181/Rettiwt-API/issues/311](https://github.com/Rishikant181/Rettiwt-API/issues/311)

[Vince Canger](https://hashnode.com/@vincanger)

[Jun 30, 2023](https://hashnode.com/posts/build-your-own-personal-twitter-agent-with-langchain/649c29c04c5b78227c6b5bed/comment/649e861d2a0936ab01ee1e13#reply-649ea0032a0936ab01ee21f3)

[Neutron](https://hashnode.com/@Neutron768) hey I found out the work around. It looks twitter no longer allows you to view content unless you're signed in. so you have to log in with the Rettiwt-Api once, save the tokens it returns (in your ENV VARS perhaps) and then use those to initiate the client like this. Be careful with this thought because if you dont do it correctly you could get your account suspended. Its probably best to use an alternate twitter account for this:

```
const getTokens = async () => {
  const tokens = await Rettiwt().account.login(
    process.env.TWITTER_EMAIL!,
    process.env.TWITTER_HANDLE!,
    process.env.TWITTER_PASSWORD!
  );

  console.log('tokens: ', tokens) // save these in your env vars or somewhere safe
};

//...

      const twitter = Rettiwt(tokens); // from above
      // then call twitter.tweets.getTweets() instead of twitter.users.getUserTweets
      const favUserTweets = await twitter.tweets.getTweets({
        fromUsers: [favUser],
        // endDate in format YYYY-MM-DD
        endDate: endDate,
      });
```

i'll post an update to the article and repos ASAP

[Neutron](https://hashnode.com/@Neutron768)

[Jun 30, 2023](https://hashnode.com/posts/build-your-own-personal-twitter-agent-with-langchain/649c29c04c5b78227c6b5bed/comment/649e861d2a0936ab01ee1e13#reply-649eb23a2a0936ab01ee24e0)

[Vince Canger](https://hashnode.com/@vincanger) cool, i'll update it

[Vince Canger](https://hashnode.com/@vincanger)

[Jun 30, 2023](https://hashnode.com/posts/build-your-own-personal-twitter-agent-with-langchain/649c29c04c5b78227c6b5bed/comment/649e861d2a0936ab01ee1e13#reply-649eeb022a0936ab01ee2dda)

tutorial has been updated! [Neutron](https://hashnode.com/@Neutron768)
