title: TypeError [ERR_INVALID_ARG_TYPE]: The "id" argument must be of type string. Received type object
body: <p>I´m trying to connect my app to MySql Database using require.js.  But am getting following error :</p>
  
  <blockquote>
    <p>throw new ERR_INVALID_ARG_TYPE(name, 'string', value);</p>
  </blockquote>
  
  <p>my server side code look like this : </p>
  
  <p>mijs.js</p>
  
  <pre><code>  `require(["mysql"],function(mysql) {
      var connection = mysql.createConnection({
         host: "localhost",
         user: "root",
         password: 'XXXX',
         database: 'XXXXXXX',
         port: 3306
      });
  connection.connect(function(error){
     if(error){
        throw error;
     }else{
        console.log('Conexion correcta.');
     }
  });
  });`
  </code></pre>
  
  <p>And the error message  is :</p>
  
  <pre><code>internal/validators.js:112
      throw new ERR_INVALID_ARG_TYPE(name, 'string', value);
      ^
  
  TypeError [ERR_INVALID_ARG_TYPE]: The "id" argument must be of type string. Received type object
  ←[90m    at validateString (internal/validators.js:112:11)←[39m
  ←[90m    at Module.require (internal/modules/cjs/loader.js:831:3)←[39m
  ←[90m    at require (internal/modules/cjs/helpers.js:74:18)←[39m
      at Object.&lt;anonymous&gt; (C:\xampp\htdocs\Middleware\Temas\mijs.js:3:1)
  ←[90m    at Module._compile (internal/modules/cjs/loader.js:945:30)←[39m
  ←[90m    at Object.Module._extensions..js (internal/modules/cjs/loader.js:962:10)←[39m
  ←[90m    at Module.load (internal/modules/cjs/loader.js:798:32)←[39m
  ←[90m    at Function.Module._load (internal/modules/cjs/loader.js:711:12)←[39m
  ←[90m    at Function.Module.runMain (internal/modules/cjs/loader.js:1014:10)←[39m
  ←[90m    at internal/main/run_main_module.js:17:11←[39m
  </code></pre>