Giter Club home page Giter Club logo

webpack-rails-buildpack's Issues

Issue in first installation

Hi, I'm trying install using your instructions webpack-rails-buildpack
and receiving the error the last pat of it I want to share with you
...
remote: -----> bundle exec rake webpack:compile
remote: ** Invoke webpack:compile (first_time)
remote: ** Invoke environment (first_time)
remote: ** Execute environment
remote: ** Execute webpack:compile
remote: rake aborted!
remote: Can't find our webpack config file at /tmp/build_bf4a14785e9ae6614cc312a0e773388c/config/webpack.config.js
remote: /tmp/build_bf4a14785e9ae6614cc312a0e773388c/vendor/bundle/ruby/2.2.0/gems/webpack-rails-0.9.11/lib/tasks/webpack.rake:14:in `block (2 levels) in <top (required)>'
...

What was done wrong and how I can fix it?

Make bundler version a range <2

Issue #19 pinned the bundler version on a specific one, to get around incompatibility with version 2, which was released today. We should change the version spec from specific to one that can float up to anything below 2.

Build failures installing bundler due to bundler 2.0 release

FYI, the explicit call to gem install bundler (introduced in #2) started causing build failures for us this morning as a result of Bundler releasing 2.0, which effectively has a breaking change in needing RubyGems 3.0:

-----> webpack-rails app detected
-----> gem install bundler
ERROR:  Error installing bundler:
	The last version of bundler (>= 0) to support your Ruby & RubyGems was 1.17.3. Try installing it with `gem install bundler -v 1.17.3`
	bundler requires RubyGems version >= 3.0.0. The current RubyGems version is 2.7.6. Try 'gem update --system' to update RubyGems itself.
 !     Push rejected, failed to compile webpack-rails app.
 !     Push failed

I believe a short-term fix for this would be to forcibly set the version to 1.x in the gem install command. I expect this will go away when Heroku formally supports Bundler 2.0/RubyGems 3.0 in the ruby buildpack.

Bundler conflicts with ruby-2.6.1/bin/bundle

I'm using ruby 2.6.1 and bundler 2.0.1 for my ruby app.
When I was trying to deploy app I got the following error:

remote: -----> webpack-rails app detected
remote: -----> gem install bundler
remote: ERROR:  Error installing bundler:
remote: 	"bundle" from bundler conflicts with /tmp/build_5f23e64fd8050f5654d8fe6ab7e0bd8d/vendor/ruby-2.6.1/bin/bundle
remote:  !     Push rejected, failed to compile webpack-rails app.
remote:
remote:  !     Push failed

Is there any workaround to this issue?

Previous build not restored from cache, potentially causing 404s

There is an edge case where a page loads at the same time as the deploy switches from old to new dynos. The page contains references (e.g. <script>) to out-of-date assets from the previous deploy, but the client does not have time to download them before the dynos are switched.

The new dyno then does not contain these old assets and would therefore 404. The new dyno only contains assets from the new build. This could only happen in a very short window, however it could be exaggerated by slow/flaky connections.

If the previous deploy's output assets could be pulled from cache and persisted into the new dyno, the problem would be fixed. Note that it would be sensible to restrict this to only the last deploy's output, otherwise the cache may become bloated.

Unfortunately the buildpack doesn't know where the output assets be put, and thus can't move it into the cache. The only options that I could think of to resolve this would be to assume the use of an environment variable or to somehow introspect webpack itself to find the output directory. Do you think either of these are options that you would accept a PR for?

`Can't find our webpack executable at` on Heroku

On thursday we started receiving this issue during the slug compilation on heroku.

** Execute webpack:compile
rake aborted!
Can't find our webpack executable at /tmp/build_8f0a62a90132b53a9b4b0536055c0a88/node_modules/.bin/webpack - have you run npm install?

Are there any issues you were aware of. Heroku are saying its an issue with the build pack and not heroku.

These are our current build packs:

  1. https://github.com/sofarsounds/heroku-buildpack-git-sha.git
  2. heroku/ruby
  3. heroku/nodejs
  4. https://github.com/febeling/webpack-rails-buildpack.git

As mentioned these were working but are not now.

Could not find bundler?

I added this buildpack:

=== app-staging Buildpack URLs
1. heroku/nodejs
2. heroku/ruby
3. https://github.com/febeling/webpack-rails-buildpack.git

When I deploy, I get an error related to using bundle exec

remote: -----> Fetching set buildpack https://github.com/febeling/webpack-rails-buildpack.git... done
remote: -----> webpack-rails app detected
remote: -----> bundle exec rake webpack:compile
remote: /tmp/build_e79d1dc4352be15c4a65c94ee432b514/vendor/ruby-2.2.3/lib/ruby/2.2.0/rubygems/dependency.rb:315:in `to_specs': Could not find 'bundler' (>= 0) among 9 total gem(s) (Gem::LoadError)
remote: Checked in 'GEM_PATH=vendor/bundle/ruby/1.9.1:/tmp/build_e79d1dc4352be15c4a65c94ee432b514/vendor/ruby-2.2.3/lib/ruby/gems/2.2.0', execute `gem env` for more information
remote:     from /tmp/build_e79d1dc4352be15c4a65c94ee432b514/vendor/ruby-2.2.3/lib/ruby/2.2.0/rubygems/dependency.rb:324:in `to_spec'
remote:     from /tmp/build_e79d1dc4352be15c4a65c94ee432b514/vendor/ruby-2.2.3/lib/ruby/2.2.0/rubygems/core_ext/kernel_gem.rb:64:in `gem'
remote:     from /tmp/build_e79d1dc4352be15c4a65c94ee432b514/vendor/bundle/ruby/2.2.0/bin/bundle:22:in `<main>'
remote: 
remote:  !     Push rejected, failed to compile webpack-rails app
remote: 

Any ideas?

NPM and Yarn Slapfight

It looks like this buildpack is hardcoded to use NPM instead of Yarn. We ran into a problem where Yarn was installing and respecting it's lockfile, but then NPM was coming through and installing without a lockfile, thereby overwriting some locked versions.

For the moment we just forked and removed the NPM install line. What would be the best course of action for detecting whether to use Yarn or NPM?

nodejs webpack doesn't detect package.json file

I'm not sure if this is a problem with the heroku nodejs buildpack or with this project, but I figured I would start here. I'm attempting to use the webpack-rails gem (https://github.com/mipearson/webpack-rails) with an app hosted on github. The author links to this project as a way to include the running webpack server that's required for the gem in heroku. I have added the required buildpacks to my app and I have both a Gemfile and a package.json file in the root of my project directory, but heroku returns an error when I attempt to push to it (see gist for proof). I read the source for the official nodejs buildpack, and the detect script seems to be very simple. I tried forking the repo and adding some debugging, but heroku appears to swallow all output from the detect script. Is there another way to figure out what's going on?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.