title: Code that worked on Replit doesn’t work in VSC
body: <p>Basically, my code worked completely fine in replit, but now it doesnt work in a vsc folder. my replit version also suddenly can’t send any messages anymore. it sends all the console.logs but the client.say stuff it just skips without an error.</p>
  <pre><code>    const tmi = require('tmi.js');
  
  // Define configuration options
  const opts = {
    identity: {
      username: 'BormBot',
      password: 'cut out for a reason'
    },
    channels: [
      'Epicurious__'
    ]
  };
  
  // Create a client with our options
  const client = new tmi.client(opts);
  
  const jsonFile = require('./link.json');
  const fs = require('fs');
  const mongoose = require('mongoose');
  // Register our event handlers (defined below)
  
  client.on('connected', onConnectedHandler);
  
  // Connect to Twitch:
  client.connect();
  
  
  client.on('message', (channel, tags, msg, self, target) =&gt; {
    if (self) return;
  
  
    //start of geoguessr commands
    const link = {
      &quot;link&quot;: &quot;&quot;
    };
    if (msg.startsWith('!geolink')) {
  
  
      if (tags.badges.broadcaster == 1) {
        
        const arguments = msg.split(/[ ]+/)
        if (arguments[1]) {
          let link = arguments[1];
          
  
          const data = JSON.stringify(link);
  
          fs.writeFile('./link.json', data, (err) =&gt; {
            if (err) {
              throw err;
            }
            console.log(&quot;JSON data is saved.&quot;);
  
          });
          
              client.say(channel, link);
             
        } else {
          console.log(&quot;no args&quot;);
        }
  
  
  
      }
  
  
  
  
    }
    if (msg.startsWith('!game')) {
  
      // read JSON object from file
      fs.readFile('./link.json', 'utf-8', (err, data) =&gt; {
        if (err) {
          throw err;
        }
  
        // parse JSON object
        const linkDone = JSON.parse(data.toString());
  
        // print JSON object
        client.say(channel, `The link for the current geoguessr game is: ${linkDone}`);
        console.log(`${linkDone}`);
      });
  
  
  
      }
   //end of geoguessr commands
  
  });
  
  // Called every time the bot connects to Twitch chat
  function onConnectedHandler(addr, port) {
    console.log(`* Connected to ${addr}:${port}`);
  }
  </code></pre>
  <p><a href="https://i.stack.imgur.com/5Dqvo.png" rel="nofollow noreferrer">console</a></p>
  <p>Also on twitch developer forum: <a href="https://discuss.dev.twitch.tv/t/code-that-worked-on-replit-doesnt-work-in-vsc/35826/2" rel="nofollow noreferrer">2</a></p>
  <p>On twitch developer forum there hasn't been an answer yet, hence why I'm also putting it on here. Hopefully I can find an answer, also, maybe add a tag for tmi.js</p>