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

Support sprockets #36

Closed
jacob-carlborg-apoex opened this issue Dec 20, 2024 · 5 comments · Fixed by #41
Closed

Support sprockets #36

jacob-carlborg-apoex opened this issue Dec 20, 2024 · 5 comments · Fixed by #41
Labels
enhancement New feature or request

Comments

@jacob-carlborg-apoex
Copy link
Contributor

I have a Rails application that was upgraded from Rails 7 to Rails 8 and uses Sprockets as the asset pipeline. When I just add hotwire-spark to the Gemfile I get the following error after bundling and restarting the Rails sever:

Asset `hotwire_spark.js` was not declared to be precompiled in production.
Declare links to your assets in `app/assets/config/manifest.js`.
  //= link hotwire_spark.js
and restart your server

I followed the instructions and thought everything would be fine. But that won't work in the test or production environment when the gem is only added to the development group in the Gemfile.

Is this gem not compatible with Sprockets?

@jorgemanrubia
Copy link
Member

jorgemanrubia commented Dec 20, 2024

Yes, only Propshaft now. I'd be happy to add compatibility to sprockets too someone wants to work on the PR. You can see what mission_control-jobs does to support both.

@jorgemanrubia jorgemanrubia changed the title Asset hotwire_spark.js was not declared to be precompiled in production Support sprockets Dec 20, 2024
@jorgemanrubia jorgemanrubia added the enhancement New feature or request label Dec 20, 2024
@jorgemanrubia
Copy link
Member

Released 0.1.9 with this one. Please let us know if still having trouble with sprockets. Thanks @codergeek121.

@cbmike
Copy link
Contributor

cbmike commented Dec 23, 2024

Maybe it can work with Rails 7.2 now?

@jorgemanrubia
Copy link
Member

@cbmike I'd be happy to do that. Would you mind opening a PR relaxing the Rails dependency to >= 7.0.0? Also, it would be good to test it with an actual Rails 7 app.

@cbmike
Copy link
Contributor

cbmike commented Dec 23, 2024

I've set it to 7.1.3 since I have that app. Works fine.
#42

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging a pull request may close this issue.

3 participants