Heroku build failing due to Yarn and npm lockfile conflict

Are you committing back to your master branch before pushing it up to Heroku?

Most often for me, problems like this arise when I make a code change and then 'git push heroku master' but my master branch has not been updated as I haven't yet committed my local changes.

Try

git commit -m 'some changes'

then

git push heroku master

If you use npm:

git rm yarn.lock
git commit -m "Remove yarn lock file"
git push heroku master

If you use yarn:

git rm package-lock.json
git commit -m "Remove npm lock file"
git push heroku master