Push failed (Heroku deployment error)

Your comment gave me the hint I needed.

I found this topic:

where @Dereje1 said:

"Fyi, this is what I always use on heroku postbuild with CRA apps

* *"heroku-postbuild": "cd client && npm install --only=dev && npm install && npm run build"* *

provided your client folder is in your root folder and created with CRA, delete any pre-existing build folders you may have in client as well, and delete all .lock files (yarn or package) , that works for me 90% of the time, but with the limited information that’s all I can say for now"

So, I simply changed the “heroku-postbuild” in my root package.json from

"heroku-postbuild": "cd client && npm install && npm install --only=dev --no-shrinkwrap && npm run build"

to

"heroku-postbuild": "cd client && npm install --only=dev && npm install && npm run build"

As silly as it may seem, that solved the problem for me.