Same issue here.
env/production/database.js
const parse = require("pg-connection-string").parse;
const config = parse(process.env.DATABASE_URL);
console.log(config)
module.exports = ({ env }) => ({
connection: {
client: "postgres",
connection: {
host: config.host,
port: config.port,
database: config.database,
user: config.user,
password: config.password,
ssl: {
rejectUnauthorized: false,
},
options: {
ssl: false,
},
},
debug: false,
},
});
env/production/server.js
module.exports = ({ env }) => ({
url: env('MY_HEROKU_URL'),
});
All env vars added in heroku
Error Log:
: > strapi start
2022-02-22T23:51:30.937969+00:00 app[web.1]:
2022-02-22T23:51:32.299258+00:00 app[web.1]: [Object: null prototype] {
2022-02-22T23:51:32.299284+00:00 app[web.1]: user: 'uoulcpfnfnnpdptoatpd',
2022-02-22T23:51:32.299285+00:00 app[web.1]: password: '01d98982104e5c48a93e52e9c185b3b8cb216eadbf5e3fb15f38533f62a6186b9c4a2',
2022-02-22T23:51:32.299285+00:00 app[web.1]: port: '5432',
2022-02-22T23:51:32.299286+00:00 app[web.1]: host: 'ec3-32-1357-15-2328.compute-1.amazonaws.com',
2022-02-22T23:51:32.299286+00:00 app[web.1]: database: 'd993s4lb5d2s8v92m'
2022-02-22T23:51:32.299287+00:00 app[web.1]: }
2022-02-22T23:51:33.346083+00:00 heroku[web.1]: Process exited with status 1
2022-02-22T23:51:33.451697+00:00 heroku[web.1]: State changed from starting to crashed
2022-02-22T23:51:33.088204+00:00 app[web.1]: TypeError [ERR_INVALID_ARG_TYPE]: The "string" argument must be of type string or an instance of Buffer or ArrayBuffer. Received an instance of Object
2022-02-22T23:51:33.088217+00:00 app[web.1]: at new NodeError (node:internal/errors:371:5)
2022-02-22T23:51:33.088218+00:00 app[web.1]: at Function.byteLength (node:buffer:734:11)
2022-02-22T23:51:33.088218+00:00 app[web.1]: at Writer.addCString (/app/node_modules/pg-protocol/dist/buffer-writer.js:42:30)
2022-02-22T23:51:33.088219+00:00 app[web.1]: at Object.startup (/app/node_modules/pg-protocol/dist/serializer.js:10:32)
2022-02-22T23:51:33.088219+00:00 app[web.1]: at Connection.startup (/app/node_modules/pg/lib/connection.js:123:33)
2022-02-22T23:51:33.088219+00:00 app[web.1]: at Connection.<anonymous> (/app/node_modules/pg/lib/client.js:126:11)
2022-02-22T23:51:33.088220+00:00 app[web.1]: at Connection.emit (node:events:520:28)
2022-02-22T23:51:33.088220+00:00 app[web.1]: at Connection.emit (node:domain:475:12)
2022-02-22T23:51:33.088221+00:00 app[web.1]: at Socket.<anonymous> (/app/node_modules/pg/lib/connection.js:101:12)
2022-02-22T23:51:33.088221+00:00 app[web.1]: at Object.onceWrapper (node:events:640:26)
2022-02-22T23:51:33.088221+00:00 app[web.1]: at Socket.emit (node:events:520:28)
2022-02-22T23:51:33.088222+00:00 app[web.1]: at Socket.emit (node:domain:475:12)
2022-02-22T23:51:33.088222+00:00 app[web.1]: at addChunk (node:internal/streams/readable:315:12)
2022-02-22T23:51:33.088222+00:00 app[web.1]: at readableAddChunk (node:internal/streams/readable:289:9)
2022-02-22T23:51:33.088223+00:00 app[web.1]: at Socket.Readable.push (node:internal/streams/readable:228:10)
2022-02-22T23:51:33.088223+00:00 app[web.1]: at TCP.onStreamRead (node:internal/stream_base_commons:190:23)