Skip to content
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

broken with rails 7.2? #159

Open
josh-m-sharpe opened this issue Oct 21, 2024 · 1 comment
Open

broken with rails 7.2? #159

josh-m-sharpe opened this issue Oct 21, 2024 · 1 comment

Comments

@josh-m-sharpe
Copy link

Context: I've had cssbundling-rails (1.4.1) working with a rails 7.0.x app for a while now. I got in the mood to upgrade things and it appears that things didn't play super nice with rails 7.2.1.1

My deployment has included a simple "bundle exec rake assets:precompile" but that stopped compiling my application.sass.scss file (to application.css) resulting in runtime errors post deployment.

Sprockets::Rails::Helper::AssetNotFound (The asset "application.css" is not present in the asset pipeline.

I had to modify my prod deployment to also include "yarn build:css" prior to assets:precompile.

Is this by design?

The README here says:

When you deploy your application to production, the css:build task attaches to the assets:precompile task to ensure that all your package dependencies from package.json have been installed via yarn, and then runs yarn build:css to process your stylesheet entrypoint, as it would in development

But this didn't appear quite so automatic after this 7.2 upgrade.

Let me know what other details I can provide. Thanks!

@josh-m-sharpe
Copy link
Author

this readme note is inconsistent: https://github.com/rails/cssbundling-rails?tab=readme-ov-file#why-do-i-get-applicationcss-not-in-asset-pipeline-in-production

the install script adds a .keep file not a .gitkeep file.

but regardless of the name of the file, the install script doesn't git add -f app/assets/builds/.keep which it probably should?

anyways, doing that and committing fixed this thing. so maybe we just need the install script updated and readme made consistent?

fwiw it's worth my .gitignore has

/app/assets/builds/*
!/app/assets/builds/.keep

which was added when cssbundling was originally added to the project way back when

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant