-
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
Can't properly compile assets on heroku? #1164
Comments
@dben89x Probably something to do with react on rails may be if webpacker is compiling fine?
Also, do you have webpack as dev dependency or app dependency in your package.json? |
I've been under the impression that webpack is being included as an app dependency via
I think react_on_rails is just setting the output directory here. I get the same message from react_on_rails when I successfully compile it manually from the terminal. Any suggestions on how to check if it's one or the other? Side note: when I run
I've tried changing compile in production here to true as well. Doesn't do anything. |
Were you able to fix this @dben89x ? |
Yes that's correct actually. Everything looks good to me. Have you included nodejs buildpack on heroku? |
We are having the same problem. |
@dben89x did you ever figure this out? |
Did you guys give up?? I'm having this problem too. Never give up! |
Same here. Why issue closed? |
Buildpack index 1 should be node. Procfileweb: bundle exec puma -p $PORT |
Sorry guys I forgot to come back here and post my solution back when I first figured it out but if I remember correctly @ericscottmarquez is right. The issue was the order of the buildpacks on heroku. Node needs to come first. |
Thanks for your note @ericscottmarquez and @nerboda. #739 (comment) confirms this. The following should fix this issue:
|
👍 https://github.com/rails/webpacker/blob/master/docs/deployment.md |
i know this issue is closed, but i just wanted to get a sense if anyone else has an issue with this configuration requiring a lot of devDependencies to be added as app dependencies? An example of this is that any babel dependencies would typically be included as devDependencies in a normal Node.js environment, but because the compilation/build step can't happen until after devDeps are pruned in heroku, they have to be included as app dependencies. Just seems less than ideal. Anyone else agree or have input? |
They generally would not. See my exhaustive discussion on why this is the case, here is a part of it:
TL;DR: If you need something to build your production bundle, it cannot be placed in |
okay that actually makes a lot of sense, but does force me to reevaluate my mental model of devDependencies and app dependencies. thanks @jakeNiemiec ! @hjhart that thread he references is a good discussion on the topic |
@jakeNiemiec one more question, is the nodeJs build pack still necessary in addition to the ruby build pack then? seems like it shouldn't be now that webpacker:yarn_install is available in 5.1+ |
If you're using rails and node, a good way to do this without buildpacks would be to use rails in 'api mode', deploy on heroku, and point it to your node app, deployed as a separate app. You can encrypt the json in each request. |
@jkepps Sorry, I'm the wrong person to ask. I haven't used Heroku that much. |
Just a heads up... One thing I saw was that |
How do you do? |
I've tried to build this dozens of times on production using react_on_rails, but keep getting the following error:
I've come across #727 and #739, but still having issues. I've tried deploying via Travis CI, and running
yarn install
during the build.My heroku buildpacks are:
I've ensured the following by running
heroku run bash
in my environment:~/node_modules/.bin/webpack
exists.If I manually run
rake webpacker:compile
via heroku's command line, it says it successfully gives me this:At which point I can see all the packs I need in
~/public/packs
.I've been racking my brain over this for days and not too sure what else to try.
The text was updated successfully, but these errors were encountered: