樂活達康

一輩子都要學習的人生態度

[fixed] Sequelize: warning: "a promise was created in a handler but was not returned from it"

leave a comment »

Sequelize: warning: “a promise was created in a handler but was not returned from it"

problem:

when running sequelize, and console display error message below, accroding to sequelize issues, the information dose not effect anything about process.

Warning: a promise was created in a handler but was not returned from it
at [object Object].Instance.save (/home/tremby/myproject/node_modules/sequelize/lib/instance.js:567:18)
at [object Object].Model.create (/home/tremby/myproject/node_modules/sequelize/lib/model.js:1824:6)
at [object Object].HasMany.create (/home/tremby/myproject/node_modules/sequelize/lib/associations/has-many.js:533:29)
at [object Object].obj.(anonymous function) [as createGameSession] (/home/tremby/myproject/node_modules/sequelize/lib/associations/has-many.js:259:24)
at done (/home/tremby/myproject/src/app/routes/myroute.coffee:43:10)
at [object Object]. (/home/tremby/myproject/src/app/routes/myroute.coffee:58:7)
at processImmediate [as _immediateCallback] (timers.js:383:17)
From previous event:
...

but it is still buggy,

solution

it is simple, if you are running code as development, please setup NODE_ENV for yourself.
then it works.

export NODE_ENV=development

Ref,

https://github.com/sequelize/sequelize/issues/4883

Written by Caesar Chi

25 三月, 2016 於 10:50 上午

發表留言