title: Vue.js web application using a Node.js connection with mysql-ssh
body: <p>I am working on a course project using Vue.js to create the front-end web application.  I am extremely new with how the front and back ends speak to each other.  My teammate created the Node.js code below (sensitive information left out):</p>
  
  <pre><code>const mysqlssh = require('mysql-ssh');
  const fs = require('fs');
  var commands = require('./commandList');
  var command = commands.cmd;
  var output;
  mysqlssh.connect(
      {
          host: 'address',
          user: 'root',
          password: 'pwd'
      },
      {
          host: 'localhost',
          user: 'root',
          password: 'pws',
          database: 'db-name'
      }
  )
  .then(client =&gt; {
      client.query(command, function (err, results, fields) {//command is query
          if (err) throw err//throws error if anything in the connection goes wrong
          console.log(results);//logs results of query
          output = JSON.stringify(results);//output = results of query
         // var i = output.lastIndexOf('"');//gets last "
         // output = output.slice(0, i);//slices off last " and everything after it
          //i = output.lastIndexOf('"');//gets new last "
         // output = output.slice(i+1, output.length);//slices new last " and everything before it
         // console.log(output);//prints output to console
          mysqlssh.close()//close sql ssh
      })
  })
  .catch(err =&gt; {
      console.log(err)
      })
  </code></pre>
  
  <p>The file works just fine when running <code>node db.js</code></p>
  
  <p>However, when I attempt to use <code>import</code> or <code>require</code> or even copy and paste this into my App.vue file, the project throws a compile error that is not descriptive: <br>
  WARNING: in ./node_modules/defaultable/defaultable.js
  Critical dependency: the request of a dependency is an expression <br>
  <a href="https://i.stack.imgur.com/CspWI.jpg" rel="nofollow noreferrer">Compile Error</a><br>
  And when viewing the project within the browser, I see this error in the Console: <br>
  Uncaught Error: Cannot find module 'net'. <br>
  <a href="https://i.stack.imgur.com/LzQd2.jpg" rel="nofollow noreferrer">Browser Error</a> <br>
  This appears it is part of the <code>net</code> module of Node.js and as I understand it, this cannot run on the browser.  I am not looking for code critique, but I would like to know if there is a way to implement this setup without reworking the code that connects to the MySQL database.</p>