Node.js mssql error: tedious deprecated The default value for `config.options.enableArithAbort` will change from `false` to `true`

Viewed 14367

I get the error below. How do I fix it?

tedious deprecated The default value for `config.options.enableArithAbort` will change from `false` to `true` in the next major version of `tedious`. Set the value to `true` or `false` explicitly to silence this message. node_modules\mssql\lib\tedious\connection-pool.js:61:23

4 Answers

Change your database config options to the following:

     var config = {
      user: 'username',
      password: 'password',
      server: 'localhost', 
      database: 'databasename',
      "options": {
        "encrypt": true,
        "enableArithAbort": true
        }
   };

read issue details here: https://github.com/tediousjs/node-mssql/issues/976

instead of setting in config in your project, set the value in node_modules node_modules/sequelize/lib/dialects/mssql/connection-manager.js.

options: {
   enableArithAbort: true,//<----------set this to true
   port: parseInt(config.port, 10),
   database: config.database,
   trustServerCertificate: true
}

The following worked for me :

const config = {

    user: 'sa',

    password: '<YOUR_PASSWORD>',

    server: '<COMPUTER_NAME>\\SQLEXPRESS',

    database: '<DBNAME>',

    requestTimeout: 180000, // for timeout setting

    connectionTimeout: 180000, // for timeout setting

      "options": {

        "encrypt": false, // need to stop ssl checking in case of local db

        "enableArithAbort": true

        }
}

According to tedious docs and SET ARITHABORT

enableArithAbort: true // Ends a query when an overflow or divide-by-zero error occurs during query execution.  

encrypt: true, // A boolean determining whether or not the connection will be encrypted. Set to true if you're on Windows Azure.
Related