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
}
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.
Related videos on Youtube
Author by
Argon
Senior software engineer @idsnext , Author @technewsLK | http://technews.lk
Updated on July 09, 2022Comments
-
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_ about 4 years@leochet I have changed the boolean value to Integer but Still showing the same error.
-
leoschet about 4 years@Rabbani_ did you use integers or strings containing the digits?
-
Rabbani_ about 4 yearsI am using Integer .
-
leoschet about 4 yearsyou need a string
-
Brad over 3 yearsThis really isn't an appropriate answer, and doesn't solve anything.
-
Andreas over 3 yearsThis 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 over 3 yearsThanks might not be the best solution but was what make me notice what this was referencing to.