TypeError - Cannot read property 'on' of undefined
See original GitHub issueWhat you are doing?
I’m running Red Hat Enterprise Linux Server 7.2 (Maipo) and can’t seem to get my models to sync. Strangely, it used to sync up before, but after deleting the models (and also the cascaded objects), I can’t seem to get sync working anymore. It works locally on my OS X using the exact same code.
Edit: It stopped working locally after I cleared my npm cache and reinstalled all my node modules.
One of my models looks like this, with its syntax correct - verified and checked:
var Pizza = sequelize.define('pizza', {
translated: Sequelize.JSON,
related: Sequelize.ARRAY(Sequelize.STRING),
native: Sequelize.STRING,
stripped: Sequelize.STRING
});
What do you expect to happen?
My database should sync the new models up.
What is actually happening?
I keep getting this error (n number of times the amount I call sync() on my models) and the error message doesn’t really help me resolve or debug.
Unhandled rejection TypeError: Cannot read property 'on' of undefined
at /home/path/node_modules/sequelize/lib/dialects/postgres/connection-manager.js:158:9
at Promise._execute (/home/path/node_modules/bluebird/js/release/debuggability.js:299:9)
at Promise._resolveFromExecutor (/home/path/node_modules/bluebird/js/release/promise.js:481:18)
at new Promise (/home/path/node_modules/bluebird/js/release/promise.js:77:14)
at /home/path/node_modules/sequelize/lib/dialects/postgres/connection-manager.js:155:12
at PassThroughHandlerContext.finallyHandler (/home/path/node_modules/bluebird/js/release/finally.js:56:23)
at PassThroughHandlerContext.tryCatcher (/home/path/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/home/path/node_modules/bluebird/js/release/promise.js:510:31)
at Promise._settlePromise (/home/path/node_modules/bluebird/js/release/promise.js:567:18)
at Promise._settlePromise0 (/home/path/node_modules/bluebird/js/release/promise.js:612:10)
at Promise._settlePromises (/home/path/node_modules/bluebird/js/release/promise.js:691:18)
at Async._drainQueue (/home/path/node_modules/bluebird/js/release/async.js:138:16)
at Async._drainQueues (/home/path/node_modules/bluebird/js/release/async.js:148:10)
at Immediate.Async.drainQueues (/home/path/node_modules/bluebird/js/release/async.js:17:14)
at ZoneDelegate.invokeTask (/home/path/node_modules/zone.js/dist/zone-node.js:225:37)
at Zone.runTask (/home/path/node_modules/zone.js/dist/zone-node.js:125:47)
What is on
referring to and how can I resolve this problem? Bug?
Dialect: postgres Database version: 9.2.15 Sequelize version: 3.24.3
Issue Analytics
- State:
- Created 7 years ago
- Comments:10 (3 by maintainers)
I have the same error, when you rollback zone.js to version 0.6.21 the error goes way. Looks like its a problem with the newest version of zone.js
it might be related with https://github.com/angular/zone.js/issues/455
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is still an issue, just leave a comment 🙂