-
Notifications
You must be signed in to change notification settings - Fork 97
Fix Heroku precompile in assets build folder #41
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
Comments
cc @schneems, do we need to do anything on the Rails side to ensure that app/assets/builds work out of the box? |
Perhaps there's something special about Tailwind worked out of the box for me in Heroku without any problems:
Heroku logs
|
🙇 Bruno. Yeah, a difference I see is this line being different (only because Tailwind compiles differently):
...but I don't think that's the issue. I also noticed that you are still requiring SASS Rails gem which you shouldn't need anymore once you've switched over to this new CSS Bundling gem? This means you are still installing the Ruby SASSC library and possibly Heroku needs all of this still? ...but that also defeats the point of what this gem is trying to do. |
I personally use postcss to build the css and it works perfectly fine on heroku. Postcss is also recommended by tailwind docs.
There's actually no real need to use sass-rails or sassc gem. I've generated the app using
|
🙇 Saurabh. Good tip. Yeah, I'm going to experiment with that more and see if that helps. ℹ️ I'm going to close this issue in favor of pursuing other vectors to enhance what this gem is doing further since it sounds like what I'm running into is beyond the scope of what this gem probably wants to tackle. Thanks all! |
Uh oh!
There was an error while loading. Please reload this page.
Overview
I've been working on an application that originally was using Sprockets for it's asset pipeline and then switched over to using the new CSS Bundling gem and discovered, upon deploy, that Heroku doesn't like assets being built in the
app/assets/builds
folder.I'm not entirely sure if this is a bug with this gem or with Heroku but opted to log this issue here first.
Steps to Recreate
Run the following script:
rails new demo --skip-git --skip-turbolinks --skip-action-cable --skip-action-text --skip-active-storage --skip-webpack-install --skip-listen --skip-spring --skip-test --skip-keeps --no-skip-sprockets --database postgresql bundle add cssbundling-rails bundle exec rails css:install:sass
If you open the auto-generated
package.json
, you'll find this line:The problem is, upon deploy to Heroku, you'll end up with the following stack dump:
Heroku Stack Dump
Unfortunately, Heroku only cares about these folders:
Desired Behavior
It would be nice if Heroku supported the
/app/assets/builds
folder. As a temporary workaround, I updated the following files to correct the issue:package.json
→ Switched to building in theapp/assets/stylesheets
folder.app/assets/config/manifest.js
→ Removed//= link_tree ../builds
entry.These changed allowed the deploy to Heroku to succeed. Maybe there is a better way to handle this entirely?
Environment
The text was updated successfully, but these errors were encountered: