I have a Rails application using React, Webpack, and Yarn for the client side. I have everything relating to the client side within the /client directory. This includes my yarn.
Make sure to use both ruby and node buildpacks. I got this error when I didn't.
Execute these in your root folder:
heroku buildpacks:set heroku/ruby
heroku buildpacks:add --index 1 heroku/nodejs
Sources: https://devcenter.heroku.com/articles/using-multiple-buildpacks-for-an-app
https://github.com/shakacode/react_on_rails/blob/master/docs/additional-reading/heroku-deployment.md