-
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
Heroku error: didn't find any digests file && ActionView::Template::Error (Can't find hello_react) #116
Comments
Which version of Rails are you using? |
@ytbryan Do you have the repo somewhere on github? You generally don't need to do assets:precompile, there is a hook that does that when rails run assets:precompile on production. webpacker/lib/tasks/webpacker.rake Line 140 in 652afad
I will try your steps and see if I can reproduce it. Mostly likely it's related to Rails version you have used. |
From the error log above:
I suspect that Using webpacker 1.0 with Rails 5.0, that hook executes, but I hope that makes sense! |
@sealocal Rails 5.0.1 @gauravtiwari https://github.com/ytbryan/webpacker-demos gonna be away for the next two days, will look at all these info and dig into it when i'm back. |
Thanks @ytbryan. @sealocal Yes I get the same error that webpack isn't found. If we use node buildpack for heroku it does detects yarn and run yarn install by default, which I can see in the log that it installs all dependencies but not the one listed in devDependencies, that's why it can't find webpack. |
@ytbryan this works - https://webpacker-vue.herokuapp.com/ and code here - https://github.com/gauravtiwari/webpacker-vue The only additions are - adding correct buildpacks for heroku
And add a Procfile to run webpack dev server + configuration in development.rb and moving all the devDependencies except webpack dev server to dependencies block. Strangely, yarn doesn't seem to install them on production. There are many issues filed on Github in same regards, here is one - yarnpkg/yarn#2739 |
@sealocal This explains more - https://yarnpkg.com/lang/en/docs/cli/install/#toc-yarn-install-production so, perhaps by default the gem installer should list those modules, which will be used in production should be under dependencies by default. |
You're right. I haven't tried deploying my app to Heroku - so I can see that you're saying Heroku installed only the production dependencies. However, my problem is slightly different. On Beanstalk, yarn is not available to install on Amazon Linux Ruby. I've installed it manually, but would prefer to check for the binary and install upon deploy. I'm using Beanstalk's Ruby platform:
I can open another issue for discussion around Beanstalk deployment. |
@ytbryan Deployed updated version here - https://webpacker-demos-vue.herokuapp.com/ and made PR for you - ytbryan/webpacker-demos#1 |
@sealocal You can use .ebextensions as pre deploy hook to setup yarn for linux using this guide - https://yarnpkg.com/en/docs/install/#linux-tab ? As an example (not sure it works though),
Resource: http://www.eq8.eu/blogs/29-aws-elasticbeanstalk-deployment-hooks |
Heroku was discussed over here as well: #90 (comment) Not sure if DHH still has an opposing view on the topic. |
@gauravtiwari Thanks for the input! Did you grab that yarn.config snippet from StackOverflow? You'll see my comment right below it : D I get that there are pre/post deploy hooks on AWS, but I haven't found the right combination that works for me. That particular |
@sealocal Yeah, unfortunately I haven't used beanstalk, just EC2 :) Is it not possible to manually install node.js platform too alongside ruby one? |
Actually node and npm are installed on the Ruby platform, but installing yarn so that the |
I believe even once your buildpacks are set correctly and Added a #125 so that errors like the below are actually visible. Will maybe add another PR to update the README with some Heroku instructions.
@ytbryan Probably need to specify the vue versions in |
Nice! okay for @gauravtiwari to close this ticket? |
I was having this issue on Heroku and realized it was because yarn won't install devDependencies when NODE_ENV=production. I fixed this by setting |
@swrobel This is fixed on master, please do bundle update and try again. Let me know. |
@gauravtiwari fixed on master without the ENV var, thanks! |
Step to reproduce:
gem 'webpacker', :git => "https://github.com/rails/webpacker.git"
ERROR (didn't find any digests file)
To fix the above error, turns out I need to
rake assets:precompile
instead ofrails webpacker:compile
. Should the error message be modified?Once the assets are precompiled. Pushing to heroku works but leads to another error ( ActionView::Template::Error (Can't find hello_react))
Is this related to existing issues? I'm still digging
The text was updated successfully, but these errors were encountered: