title: SASL error in postgres connection with node.js
body: <p>I am having the following error when trying to make a connection to my database:</p>
  <pre><code>Conexão estbabelecida com sucesso
  Acessar http://localhost:3000
  Servidor executando na porta 3000
  C:\Users\lopes\Desktop\Javascript\novo-projeto\ExpressEWebpack\node_modules\pg\lib\sasl.js:24
      throw new Error('SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a string')
      ^
  
  Error: SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a string
      at Object.continueSession (C:\Users\lopes\Desktop\Javascript\novo-projeto\ExpressEWebpack\node_modules\pg\lib\sasl.js:24:11)
      at Client._handleAuthSASLContinue (C:\Users\lopes\Desktop\Javascript\novo-projeto\ExpressEWebpack\node_modules\pg\lib\client.js:257:10)
      at Connection.emit (events.js:315:20)
      at C:\Users\lopes\Desktop\Javascript\novo-projeto\ExpressEWebpack\node_modules\pg\lib\connection.js:114:12
      at Parser.parse (C:\Users\lopes\Desktop\Javascript\novo-projeto\ExpressEWebpack\node_modules\pg-protocol\dist\parser.js:40:17)
      at Socket.&lt;anonymous&gt; (C:\Users\lopes\Desktop\Javascript\novo-projeto\ExpressEWebpack\node_modules\pg-protocol\dist\index.js:11:42)
      at Socket.emit (events.js:315:20)
      at addChunk (internal/streams/readable.js:309:12)
      at readableAddChunk (internal/streams/readable.js:284:9)
      at Socket.Readable.push (internal/streams/readable.js:223:10)
  [nodemon] app crashed - waiting for file changes before starting...
  </code></pre>
  <p>Heres my code to connection</p>
  <pre><code>require('dotenv').config();
  const express = require('express');
  const app = express(); 
  const { Sequelize } = require('sequelize');
  const sequelize = new Sequelize(process.env.DB_URL);
  
  try {
      sequelize.authenticate();
      console.log('Conexão estbabelecida com sucesso')
  }catch{
      console.log('Erro ao estabelecer conexão');
  }
  
  const session = require('express-session');
  const flash = require('connect-flash');
  
  const routes = require('./routes')
  const path = require('path');
  
  
  app.use(express.urlencoded({  extended:true }));
  
  app.use(express.static(path.resolve(__dirname, 'public')));
  
  const sessionOptions = session({
      secret:process.env.cookie_secret,
      store: new (require('connect-pg-simple')(session))(),
      resave: false,
      saveUninitialized: false,
      cookie: {maxAge: 1000 * 60 * 60 * 24 * 7}
  });
  
  app.use(sessionOptions);
  app.use(flash());
  
  app.set('views', path.resolve(__dirname, 'src', 'views'));
  app.set('view engine', 'ejs');
  
  app.use(routes);
  
  app.listen(3000, () =&gt; {
      console.log('Acessar http://localhost:3000');
      console.log('Servidor executando na porta 3000');
  });
  </code></pre>
  <p>I having this error but my dabatase doenst have a password at all, the fact that i dont have a password could interfere in the connection? In some way,password receives null for having no value? I tried to resolve,seeing what's on sasl.js,but it didn't help much</p>