-
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 and webpacker v3.0.0 #739
Comments
See #727 Webpacker 3.0 requires Yarn >= 0.25.2 |
yes on my local machine with yarn v0.27.5 it works good. Seems heroku need some time to upgrade yarn version. |
Looks like a PR is needed in the Ruby buildpack to change it: https://github.com/heroku/heroku-buildpack-ruby/blob/78eefa66b96fd04b4738ad8ed66d9bd038324064/lib/language_pack/helpers/nodebin.rb#L21 I suggest you open an issue on this repo, the maintainers are quite responsive. |
I just opened #740, which adds a yarn requirement to |
Yeah heroku respects the engines requirement - https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version, will take a look at the PR now and we can merge 👍 |
I don't know if that'll work for an engines requirement from a dependency. Might only be for your app's package.json . |
@gauravtiwari It seems like you are using multiple (node + ruby) buildpacks. |
If you need a temporary workaround, you can update your app's --- a/bin/webpack
+++ b/bin/webpack
@@ -20,7 +20,7 @@ unless File.exist?(WEBPACK_CONFIG)
end
env = { "NODE_PATH" => NODE_MODULES_PATH.shellescape }
-cmd = [ "#{NODE_MODULES_PATH}/.bin/webpack", "--config", WEBPACK_CONFIG ] + ARGV
+cmd = [ "yarn", "run", "webpack", "--config", WEBPACK_CONFIG ] + ARGV |
@WoH Oh yes, can confirm - since it's hardcoded. I guess the easiest fix would be to use both ruby and node js buildpack together and that way you don't need to modify anything for now 👍 heroku buildpacks:add heroku/nodejs
heroku buildpacks:add heroku/ruby |
@gauravtiwari
Note, it seems that order is important.
If for some reason the above doesn't work alone I'm also including
in my package.json which |
@vavgustov I believe you should be all set here now. I am using webpacker 3 with vue 2 and rails 5.1 on Heroku just swimmingly :) Feel free to reach out if you are still having issues and maybe I can help you out. Helpful hints:
|
@caseyprovost thanks, yes I use solution with node buildpack and found it optimal while heroku works on ruby buildpack improvements. I guess they will add support for From my side I would recommend these links for those who have troubles with node + ruby buildpacks:
|
Just wanted to add that @johnrees's solution worked for me. I ran these commands and the next deploy worked 👍
|
@johnrees thanks 💯 👍 |
Sorry for the delay responding here. You can also do a Upgrading the system version of Yarn to v1.0.2 would resolve the issue. Any problems doing that? |
@schneems Thanks, that should work 👍 💯 |
|
Thank you! 👍 💯 |
Is it mandatory to fiddle with the heroku buildpacks or is it a temporary fix ? |
Until this PR is merged: heroku/heroku-buildpack-ruby#620 |
[close rails/webpacker#739] Upgrade Yarn to 1.0.2
I just merged in yarn 1.0.2 into the master branch of the buildpack. If there's no regressions or issues reported then i'll deploy it shortly. In the mean time use the |
* Remove sqlite3 gem as it isn't supported on Heroku * Add staging environment to database.yml * Fix: Not a git repository (or any parent up to mount point /app) * Copy example database.yml.postgresql before running db:setup * The "db:setup" setup task isn't supported It causes following errors as the "db:reset" subtask cannot be run on Heroku. FATAL: permission denied for database "postgres" DETAIL: User does not have CONNECT privilege. * Fix: Missing for 'staging' environment * Don't force SSL in staging environment * Add staging environment config in "config/webpacker.yml" * Try 'webpacker:compile' task in postdeploy hook * Changes in config/webpacker.yml * Add 'nodejs' buildback (Ref: rails/webpacker#739) * Cleanup
**Why**: After upgrading to the latest webpacker, assets failed to compile on Heroku. This issue says you need to add the nodejs buildpack: rails/webpacker#739 I also removed unnecessary items from app.json.
**Why**: After upgrading to the latest webpacker, assets failed to compile on Heroku. This issue says you need to add the nodejs buildpack: rails/webpacker#739 Make sure the nodejs buildpack comes before the ruby one. I also removed unnecessary items from app.json.
**Why**: After upgrading to the latest webpacker, assets failed to compile on Heroku. This issue says you need to add the nodejs buildpack: rails/webpacker#739 Make sure the nodejs buildpack comes before the ruby one. For existing apps, this can be done like so: heroku buildpacks:add heroku/nodejs -i 1 -a your_app_name I also removed unnecessary items from app.json.
**Why**: After upgrading to the latest webpacker, assets failed to compile on Heroku. This issue says you need to add the nodejs buildpack: rails/webpacker#739 Make sure the nodejs buildpack comes before the ruby one. For existing apps, this can be done like so: heroku buildpacks:add heroku/nodejs -i 1 -a your_app_name I also removed unnecessary items from app.json.
FWIW I needed to manually reorder them from the Heroku dashboard in order for my deploy to work. |
Heroku can't precompile assets with webpacker v3.0.0 but v.2.0.0 worked ok. It's because .bin/webpack doesn't exist:
Content of
/app/node_modules/.bin/
:~/node_modules/.bin $ ls webpack-dev-server
Seems yarn v0.22.0 doesn't install bins for nested dependencies (in this case for
@rails/webpacker
). So if I addwebpack
as dependency then it works. It seems more like heroku/yarn issue but wanted to let you know.The text was updated successfully, but these errors were encountered: