heroku: error Command "webpack" not found. · Issue #512 · rails/webpacker

Hello, I spent the day migrating an old rails 4 app with the gem react_rails to a new rails 5.1 app with webpacker. Everything works perfectly well, except when I try to deploy the app on heroku.