Warning: a promise was created in a handler but was not returned from it
See original GitHub issueI’m submitting a…
- Bug report
- Feature request
Current behavior
When running any migration (up or down) the following error presents itself:
Warning: a promise was created in a handler but was not returned from it
at Function.Migration.registerHook (/Users/jessevanderwerf/taskspace/cloud-service/node_modules/db-migrate/lib/migration.js:41:20)
at module.exports (/Users/jessevanderwerf/taskspace/cloud-service/node_modules/db-migrate/lib/commands/helper/migration-hook.js:4:20)
at module.exports (/Users/jessevanderwerf/taskspace/cloud-service/node_modules/db-migrate/lib/commands/up.js:7:3)
at run (/Users/jessevanderwerf/taskspace/cloud-service/node_modules/db-migrate/lib/commands/run.js:64:9)
at Object.run (/Users/jessevanderwerf/taskspace/cloud-service/node_modules/db-migrate/api.js:439:16)
at /Users/jessevanderwerf/taskspace/cloud-service/node_modules/db-migrate/bin/db-migrate:36:19
at runCallback (timers.js:574:20)
at tryOnImmediate (timers.js:554:5)
at processImmediate [as _immediateCallback] (timers.js:533:5)
From previous event:
at /Users/jessevanderwerf/taskspace/cloud-service/node_modules/db-migrate/bin/db-migrate:35:8
at /Users/jessevanderwerf/taskspace/cloud-service/node_modules/resolve/lib/async.js:45:21
at ondir (/Users/jessevanderwerf/taskspace/cloud-service/node_modules/resolve/lib/async.js:196:27)
at onex (/Users/jessevanderwerf/taskspace/cloud-service/node_modules/resolve/lib/async.js:104:32)
at /Users/jessevanderwerf/taskspace/cloud-service/node_modules/resolve/lib/async.js:24:24
at FSReqWrap.oncomplete (fs.js:123:15)
Expected behavior
Migrations should return all promises and not warn on extra promises not returning.
Minimal reproduction of the problem with instructions
we have a psql db. we are currently running the following versions: db-migrate: 0.10.0 db-migrate-pg: 0.2.5 I have tried the latest published versions and still get the same error. install the latest version of db-migrate and db-migrate-pg and run a migration. I am attempting to run db-migrate up with no migrations (just to see if the warning goes away without our migrations) As a side note our migrations are all of the callback variety. It is happening for our whole team.
What is the motivation / use case for changing the behavior?
I would think that if db-migrate is leaving promises un-resolved they would like to know about it verify where (if it is in your codebase) and resolve them and if not then perhaps pin bluebird and notify them of the warnings.
Or
If its something in how we are currently using db-migrate we’d like to modify how we are doing things to remove the warning.
Environment
db-migrate version: 0.10.0
plugins with versions: 0.2.5
db-migrate driver with versions:
db-migrate-pg v0.2.5
Additional information:
- Node version: 6.5.0
- Platform: Mac
Others:
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (4 by maintainers)
Top GitHub Comments
Also take a look at what the create command creates for you. The
global.dbm
was long since removed and is not needed anymore at all. There is a setup method now.Actually impossible to reproducce, even with your examples, I do not run into any trouble executing either of those.
However this style is really really old though.
The second one would look like this today
As you’re still on node 6 and don’t have natively async/await you can fall back to: