Sequelize Error: Invalid value [object Object]

Error: Invalid value [object Object]

This happens when you think you are passing an integer or string, and you are actually passing in an object!

Somethign like this will produce the same error.

View sequelize-promise-migration.js
"use strict";
module.exports = {
up: function(queryInterface, Sequelize) {
// queryInterface methods DO return promises. Either of the following with work
// return queryInterface.addColumn(...)
// .then(() => queryInterface.doSomething(...))
// etc.
View atom.styles.less
// get rid of the yellow js file icon
// yellow means modified with the gh plugins
// change to grayish, not yellow
// add this to atom's style.less file:
.icon[data-name$=".js"]:before {
font-family: Devicons;
color: #828997;
content: "\E64E";
View test.js
//FooModule = () => {
return "hello bar";
// my file under test:
const foo = require("./FooModule");
console.log(; // returns "hello bar"
// stubbing a method to return a new value
View testTime.js
// I was testing some functionality that relied on `moment()`.
// I wanted to fake the value of the time Moment uses so I could test return values.
// Here is the method I used. Reference:
const test = require("ava");
const sinon = require("sinon");
const moment = require("moment");
let sandbox;
View promise.js
// Sometimes I have a promise chain that returns out of a promise before
// the the execution is actually completed. Maybe i'm not returning correctly?
// Anyway, might be a common problem for a newb, like me.
// here is a way to add a delay in the promise chain to wait for the previous
// promise to complete. This is NOT best practice, but maybe it can be used as
// a troubleshooting tool.
.then(() => {...})
.then(() => {

TypeError: Cannot read property 'getTableName' of undefined or is not a function

I've had this error on numerous occasions. Here are a few things to look for:

  • Check that the table name that is included in the query is spelled correctly, check that is it defined correctly (for sequelize).
  • If you are running tests and using Mockery, check that Mockery is setup correctly. Try removing Mockery and running the test.
  • Check that if you are trying to stub with Sinon, that Mockery isn't ALSO trying to stub out the same object.
  • Example of stubbing with Sinon instead of Mockery:
View BBC-Radio.m3u
#EXTINF:-1,BBC - Radio 1
#EXTINF:-1,BBC - Radio 2
#EXTINF:-1,BBC - Radio 3
#EXTINF:-1,BBC - Radio 4
#EXTINF:-1,BBC - Radio 5 live
View knit.rb
#!/usr/bin/env ruby
# recursively `yarn link` together all `file:<path>` deps in package.json
# manifests.
# AUTHOR nrser