I've seen a number of related issues when deploying application to prod but mine happens in dev. I am just getting started with a react project on ruby on rails and here I am :(
I am missing .bin/webpack under node_modules
Not sure how and when this file is generated...
This is from development.log :
[Webpacker] Compiling…
[Webpacker] Compilation failed:
/home/alik/.rvm/gems/ruby-2.5.1@sandbox/gems/webpacker-3.5.5/lib/webpacker/webpack_runner.rb:11:inexec': No such file or directory - /home/alik/RubyProjects/sandbox/node_modules/.bin/webpack (Errno::ENOENT) from /home/alik/.rvm/gems/ruby-2.5.1@sandbox/gems/webpacker-3.5.5/lib/webpacker/webpack_runner.rb:11:inblock in run'
from /home/alik/.rvm/gems/ruby-2.5.1@sandbox/gems/webpacker-3.5.5/lib/webpacker/webpack_runner.rb:10:inchdir' from /home/alik/.rvm/gems/ruby-2.5.1@sandbox/gems/webpacker-3.5.5/lib/webpacker/webpack_runner.rb:10:inrun'
from /home/alik/.rvm/gems/ruby-2.5.1@sandbox/gems/webpacker-3.5.5/lib/webpacker/runner.rb:6:inrun' from ./bin/webpack:15:in'
Completed 500 Internal Server Error in 813ms (ActiveRecord: 17.7ms)
Webpacker::Manifest::MissingEntryError - Webpacker can't find application.js in /home/alik/RubyProjects/sandbox/public/packs/manifest.json. Possible causes:
- You want to set webpacker.yml value of compile to true for your environment
unless you are using thewebpack -wor the webpack-dev-server.- webpack has not yet re-run to reflect updates.
- You have misconfigured Webpacker's config/webpacker.yml file.
- Your webpack configuration is not creating a manifest.
Your manifest contains:
{
}
Additional info
yarn installrails webpack:installsandbox$ rails -v
Rails 5.2.1
sandbox$ yarn --verison
yarn install v1.12.3
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.07s.
sandbox$ gem list | grep webpacker
webpacker (3.5.5)
Any help is greatly appreciated!!!!! Thanks!!!
+1
@alik78 did you do rails webpack:install OR rails webpacker:install. The later is the correct one. I think it should install all node dependencies.
@alik78 did you solve this problem? If yes, could you please share how you solved it?
@alik78 did you solve this problem? If yes, could you please share how you solved it?
Since I was more or less starting from scratch I've ended up following this tutorial for setting up the environment: https://cognitiveclass.ai/blog/react-on-rails-tutorial-integrating-react-and-ruby-on-rails/
What problem are you having and how does your setup look like?
@alik78 thanks for taking the time to response.
I was just trying to install webpacker on a Rails 5.2 app that had been upgraded from earlier Rails versions. I couldn't get webpack-dev-server running because the packages weren't being installed in the node_modules folder.
After deleting a number of files (including yarn.lock that was being created in a directory above the intended directory ie /Users/me/), and running rails app:update:bin I was finally able to fix my problem. I'm unsure of the exact cause and exact fix but I no longer experience the problem.
Should we close this issue seeing as we both don't have the problem any more?
Yes, this can be closed. Looks like a dependency issue. I wish the error message was more meaningful but this is not a bug
This may help anyone in the future
Hello, Noob here, but I had this same issue and this worked for me...
in the terminal run
yarn add @rails/webpacker
bundle update webpacker
from:
https://github.com/rails/webpacker/issues/1494#issuecomment-388305305
Most helpful comment
Hello, Noob here, but I had this same issue and this worked for me...
in the terminal run
from:
https://github.com/rails/webpacker/issues/1494#issuecomment-388305305