Cannot read property '0' of undefined with pg 7
See original GitHub issueWhat you are doing?
I just upgraded to Sequelize 4.4.2 and node-postgres (pg) version 7.0.2
Then, when I call sync() to connecto the db and create tables. I get an error
It happens, for example, when I run this command:
models.sequelize.sync({force: true}).
What do you expect to happen?
Sequelize should connect to Postgres and the create tables.
What is actually happening?
TypeError: Cannot read property 'Symbol(Symbol.iterator)' of undefined
at Promise.then.result (C:\test\node_modules\sequelize\lib\dialects\postgres\connection-manager.js:157:31)
at tryCatcher (C:\test\node_modules\bluebird\js\release\util.js:16:23)
at Promise._settlePromiseFromHandler (C:\test\node_modules\bluebird\js\release\promise.js:512:31)
at Promise._settlePromise (C:\test\node_modules\bluebird\js\release\promise.js:569:18)
at Promise._settlePromise0 (C:\test\node_modules\bluebird\js\release\promise.js:614:10)
at Promise._settlePromises (C:\test\node_modules\bluebird\js\release\promise.js:693:18)
at Async._drainQueue (C:\test\node_modules\bluebird\js\release\async.js:133:16)
at Async._drainQueues (C:\test\node_modules\bluebird\js\release\async.js:143:10)
at Immediate.Async.drainQueues (C:\test\node_modules\bluebird\js\release\async.js:17:14)
at runCallback (timers.js:651:20)
at tryOnImmediate (timers.js:624:5)
at processImmediate [as _immediateCallback] (timers.js:596:5)
__Dialect: postgres __Database version: 9.6.2 (pg 7.0.2) __Sequelize version: 4.4.2
Issue Analytics
- State:
- Created 6 years ago
- Reactions:53
- Comments:70 (5 by maintainers)
Top Results From Across the Web
What is this error?: TypeError: Cannot read property '0' of ...
The error basically happens every time I click submit on the website. That's the first problem, the second is after I click submit...
Read more >How to Prevent the Error: Cannot Read Property '0' of Undefined
A guide on how to prevent the error "cannot Read Property '0' of Undefined", covering techniques such as try, catch, using const over...
Read more >"Cannot read property "0" from undefined" Error - ServiceNow
Hello All, The "Cannot read property "0" from undefined" error is displayed. So checked property and got this below code snippet.
Read more >Uncaught TypeError: Cannot read property of undefined In
Uncaught TypeError : Cannot read property of undefined error occurs in Chrome when you read a property or call a method on an...
Read more >TypeError cannot read property '0' of undefined in Pavlovia
TypeError : Cannot read properties of undefined (reading 0) ... did not press any keys at all except the space bar to move...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I just installed pg@6.4.1. it may be an issue related with the support for pg ^7.0.2
I found that switching from
findOrCreate
tofindCreateFind
(documentation here) solved this issue for me