Deploying to Heroku: Command "webpack" not found

When I try to deploy to Heroku, I receive this error. Command "webpack" not found. I’ve tried solutions like looking into yarn and installing a package.json in the root. I’m not completely sure but I feel the problem could lie in my package.json needing additional information regarding ‘webpack’.

here is the error in the console:

Rails version :

Ruby version : 2.7.1

I remember I was fighting with this, but can not remember now how I resolved it. What is your build pack?

Try add a nodeJS buildpack (make sure it is above Ruby buildpack) in Heroku dashboard -> your app -> Settings -> Buildpack


Has anyone managed to solve this? I’m having a similar issue locally, yarn install is successful, but webpack is not found when starting rails server.

I’m having this same issue still. I’ve tried adding the build packs, I’ve tried without them. I’ve tried moving dependencies from devDependencies, no dice there either. When I run heroku run bash, and run which webpack, I get nothing. I’m seeing this issue all over github, but no solutions seem to exist that work for everyone.

Hey, I never resolved the issue, just had to recreate the app, copy all the code and try redeploying it. It worked out the second time.