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

28,208

Solution 1

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.

Solution 2

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"

Solution 3

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

Solution 4

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.

Share:
28,208

Related videos on Youtube

Argon
Author by

Argon

Senior software engineer @idsnext , Author @technewsLK | http://technews.lk

Updated on July 09, 2022

Comments

  • Argon
    Argon over 1 year

    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?

  • Rabbani_
    Rabbani_ about 4 years
    @leochet I have changed the boolean value to Integer but Still showing the same error.
  • leoschet
    leoschet about 4 years
    @Rabbani_ did you use integers or strings containing the digits?
  • Rabbani_
    Rabbani_ about 4 years
    I am using Integer .
  • leoschet
    leoschet about 4 years
    you need a string
  • Brad
    Brad over 3 years
    This really isn't an appropriate answer, and doesn't solve anything.
  • Andreas
    Andreas over 3 years
    This is the appropriate answer, as far as i tested it. However, if you use the logging option, you should make it 0 (int), not '0' (string), or else it will throw an error. You should change all options you provide to sequelize options of type boolean to 0 (if false) and 1 (if true)
  • Bruno
    Bruno over 3 years
    Thanks might not be the best solution but was what make me notice what this was referencing to.