-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Command "webpack" not found. #522
Comments
Please read #512 Do you think this fix your problem? |
I don't think so. It shouldn't be necessary to add the node buildpack, Node is already available in the Ruby buildpack. Heroku invokes |
@ytbryan the buildpack maintainer here. You do not need to use the Node buildpack. |
cc @gauravtiwari what do you think is the issue here? |
@johnbeynon Do you have yarn binstub in your bin folder? |
@schneems Do you think it would be better and makes sense if Heroku takes cares of this? Rails with webpacker is essentially a Ruby + Node app and therefore it should have same deployment behaviour as Ruby and Node buildpack combined. |
I'm trying to take care of it. We installed Ruby and we installed yarn. I don't know what is failing or why? Do you know where in the code that error message comes from I have access to that app (John actually works for Heroku, this is an internal app that he's working for). I tried generating that binstub, but that file is not generated:
This is in:
|
@schneems From here - https://github.com/rails/webpacker/blob/master/lib/install/bin/webpack.tt#L23 So the compiler invokes the binstub which tries to run webpack executable using |
Looks like it's only gets generated with |
Thanks! I manually created
Then made the file executable via chmod. After adding to git and deploying, it got rid of this specific error. Weird that this was required as Questions
|
Ideally, I would suggest to include this behaviour as default like in Node buildpack. #367 removed yarn binstub from webpacker in favour of using yarn executable directly on the system. The problem here is the app is generated/upgraded locally where a user either manually runs Until we have a proper solution, perhaps we put back the yarn binstub that was removed in #367 so we don't break the current deployment workflow for users who are either on rails < 5.1 or transitioning to Rails 5.1. What do you think? |
Oh so it's only problem with Rails 5.1 where |
I'm not sure. I don't totally know what everything here does. What does the |
Yes, it's bit confusing actually - The idea was to simply use You see here -
yarn:install task is present (from rails 5.1+) and if not we are enhancing it with webpacker yarn_install - https://github.com/rails/webpacker/blob/master/lib/tasks/webpacker/yarn_install.rake
Now if an app is just updated to Rails 5.1 and does't have |
For anyone updating from Rails 4.x to 5.1.x to add yarn binstub - bundle config --delete bin
# Will create yarn binstub
rails app:update:bin
git add bin |
* webpack or webpack-dev-server not found Add to troubleshooting of readme to prevent such issues #379 (comment), #506 * Update README.md * Update README.md * Include solution for error occurring in heroku * Update README.md Since it is known that node buildpacks is not necessary Read: #522 (comment) * Update README.md * Update README.md Include instruction while upgrading from rails 4 to 5. * Minor update * Use ./bin/rails * Add as comment
@johnbeynon @schneems Is all okay now? I have documented this in README. |
Totally happy. Closing. |
Currently fighting this issue on Rails 4.2, Webpacker 2, Yarn 1.0.1. Is there a hotfix for this configuration? Will updating to Webpacker 3 fix the issue? Updating to Rails 5.1 is not currently an option. |
@jnfeinstein Just install webpacker, |
@gauravtiwari thank you for the suggestions. It appears that adding the |
* webpack or webpack-dev-server not found Add to troubleshooting of readme to prevent such issues rails/webpacker#379 (comment), rails/webpacker#506 * Update README.md * Update README.md * Include solution for error occurring in heroku * Update README.md Since it is known that node buildpacks is not necessary Read: rails/webpacker#522 (comment) * Update README.md * Update README.md Include instruction while upgrading from rails 4 to 5. * Minor update * Use ./bin/rails * Add as comment
Leaving this comment for folks who run across this in the future. My issue was that the version of node I had ( |
In my case After some investigation, I manually tried to add webpack using
After some research, the above problem is solved with the command below.
Then, I remove node_modules, and generate it once more using |
@mtoygar Glad you could get it working, but remember that webpack should be installed to |
thank you @jakeNiemiec , |
You need run task yarn install before assets:precompile. Look at documentation https://github.com/rails/webpacker/blob/master/docs/deployment.md |
…not found. - bundle exec rails webpacker:install - rails/webpacker#522 (comment)
* feature/webpacker-error: Fixed Webpacker::Manifest::MissingEntryError error Command "webpack" not found. - bundle exec rails webpacker:install - rails/webpacker#522 (comment)
when error happens with capistrano: before "deploy:assets:precompile", "deploy:yarn_install"
namespace :deploy do
desc 'Run rake yarn:install'
task :yarn_install do
on roles(:web) do
within release_path do
execute("cd #{release_path} && yarn install")
end
end
end
end |
I followed Dorian's advice (adding a yarn_install to the production.rb deployment file), and that worked. Although I don't understand why this should be necessary at every deployment |
i also recommend adding append :linked_dirs, 'tmp/pids', 'tmp/sockets', 'log', 'node_modules' |
Had my self a wonderful workbench - until suddenly I got the "webpack not found" virus 😃
I downgraded my node to 14.16 (originally c/p'ed a Dockerfile from some post online - and it did actually work wonders for quite some time but then all of a sudden; yeah I know - had to be me right - anyways) and did the "vax and sermon":
- and in under 5min I was up and running about 😆 thx |
* webpack or webpack-dev-server not found Add to troubleshooting of readme to prevent such issues rails/webpacker#379 (comment), rails/webpacker#506 * Update README.md * Update README.md * Include solution for error occurring in heroku * Update README.md Since it is known that node buildpacks is not necessary Read: rails/webpacker#522 (comment) * Update README.md * Update README.md Include instruction while upgrading from rails 4 to 5. * Minor update * Use ./bin/rails * Add as comment
…not found. - bundle exec rails webpacker:install - rails/webpacker#522 (comment)
* feature/webpacker-error: Fixed Webpacker::Manifest::MissingEntryError error Command "webpack" not found. - bundle exec rails webpacker:install - rails/webpacker#522 (comment)
* webpack or webpack-dev-server not found Add to troubleshooting of readme to prevent such issues rails/webpacker#379 (comment), rails/webpacker#506 * Update README.md * Update README.md * Include solution for error occurring in heroku * Update README.md Since it is known that node buildpacks is not necessary Read: rails/webpacker#522 (comment) * Update README.md * Update README.md Include instruction while upgrading from rails 4 to 5. * Minor update * Use ./bin/rails * Add as comment
I'm deploying an upgraded Rails 4.x -> 5.1 app to Heroku and am getting the error
I've gone on to the dyno directly and attempted to run
rake assets:precompile
which fails with the message:This seems to be coming from
webpacker/lib/tasks/webpacker/compile.rake
Line 13 in f35331c
Am I correct in understanding that executing
rake assets:precompile
is all that needs to occur for a deployment? ie, that handles installing the yarn dependencies etc?I found that if I do
yarn install
first and thenassets:precompile
it works - but I didn't think I had to do that.The text was updated successfully, but these errors were encountered: