Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 881
Argon Avatar asked Oct 28 '19 14:10

Argon


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.

like image 75
leoschet Avatar answered Oct 09 '22 03:10

leoschet


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"

like image 34
Varkery Avatar answered Oct 09 '22 05:10

Varkery


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.

like image 4
Brad Avatar answered Oct 09 '22 04:10

Brad


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

like image 4
yassine dotma Avatar answered Oct 09 '22 05:10

yassine dotma