The “error:0308010C:digital envelope routines::unsupported” occurs because Node.js v17 and later use OpenSSL v3.0 which has had breaking changes.
To resolve the error, set the NODE_OPTIONS environment variable to --openssl-legacy-provider
You can set this variable in heroku before the build