reactjsnode-telegram-bot-api

ReactJS - node-telegram-bot-api (Uncaught TypeError: Cannot read properties of undefined (reading 'split'))


I am trying to import the node-telegram-bot-api in my react app like so:`
import TelegramBot from "node-telegram-bot-api";

But upon doing this I get the following error in my console.
Error Image

This error is created upon importing alone and nothing else.
Is anyone able to help solve this issue?


Solution

  • The library is for nodejs as its name see that's why it's causing the issue. You can refer to this for Reactjs here maybe it will helpful for you.