My production setup in my knexfile.js looks like this:
production: {
client: 'pg',
connection: process.env.DATABASE_URL,
migrations: {
directory: './data/migrations'
},
seeds: {
directory: './data/seeds'
},
I have tried adding ssl: true
and false
and also added ssl: {rejectUnauthorized: false }
to no avail. This has never been an issue for me before so not sure why this error keeps happening. Any help is appreciated!
I was having the same exact issue and finally found my way to:
https://github.com/brianc/node-postgres/blob/master/CHANGELOG.md#pg810
Ultimately, all I had to do was to add the suggested Environment variable on the Heroku dashboard. (PGSSLMODE=no-verify
)
Heroku Config Vars
It's also worth mentioning that I made sure to have the most recent versions of both PG and Knex in my package.json file
"dependencies": {
"knex": "^0.95.1",
"pg": "^8.5.1",
},
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With