DeprecationWarning: A boolean value was passed to options.operatorsAliases. This is a no-op with v5 and should be removed

Viewed 31297

I'm getting below error on expressJs with Sequelize

DeprecationWarning: A boolean value was passed to options.operatorsAliases. This is a no-op with v5 and should be removed.

Any idea to fix this?

4 Answers

This is not an error, it's simply a warning stating that passing boolean values to operatorsAliases in sequelize options will be deprecated in v5.

To remove the warning, replace the boolean value by '1' or '0' for true and false respectively.

Based on my experience

Go to your file

app\models\index.js

const sequelize = new Sequelize(
...
    operatorsAliases: 0, // change this to zero

...
);

run again

"node server.js"

The operatorsAliases as a boolean no longer exists. If you were simply setting it to false before, you can completely remove operatorsAliases from your config. It only existed as a backwards compatibility option.

Go app\models\index.js and change operatorsAliases false to zero

const sequelize = new Sequelize(
    operatorsAliases: 0, // change false to zero
}

enter image description here

Related