title: TypeError: Class extends value #<Object> is not a constructor or null
body: <p>I'm new at nodejs. I wanna make a class to do some queries in the database. so I need a database connection. I tried doing this by OOP to have a clean code. so I used 2 classes. first-class (I named it server) tried to make a connection. and the second class (named update_currencies) extended the class named 'server'.
  in the end, I tried to run an update.js-file but I take an Error: <code>[TypeError: Class extends value #&lt;Object&gt; is not a constructor or null]</code></p>
  <p>I checked the address at require-functions but they seem right. and I tested setQuery-method in the server-class and it works without error. but when I write it in separate classes like<br />
  this code, I take an Error.</p>
  <p>these codes take me Error:</p>
  <p>server.js :</p>
  <pre><code>const mysql = require('mysql')
  
  class server {
  
    connection = mysql.createConnection({
      host: 'localhost',
      user: 'root',
      password: '',
      database: 'testt'
    });
  
    constructor() {
      this.connection.connect()
    }
    
    destructor() {
      this.connection.end()
    }
  }
  
  module.exports = {
    server,
  };
  
  </code></pre>
  <p>update.js :</p>
  <pre><code>const server = require(&quot;./server&quot;);
  class update_currencies extends server {
    setQuery() {
      this.connection.query(&quot;UPDATE `currencies` SET `value` = '2.5' WHERE `currencies`.`name` = 'Dollar';&quot;,
        (err) =&gt; {
          if (err) throw err
        });
    }
  }
  
  module.exports = {
    update_currencies,
  }
  
  var Jafar = new update_currencies();
  Jafar.setQuery();
  Jafar.destructor();
  
  </code></pre>