-
Notifications
You must be signed in to change notification settings - Fork 91
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
404 on assets/stimulus-loading.js with config.assets.digest set to false #108
Comments
Hi @mrkcor, I just came to this repo to report the same bug. Thank you for the workarounds! |
You're welcome @tripptuttle 😃 |
Thanks @mrkcor, this helped me as well! |
You're welcome @rogerkk 🙂 |
Possibly related to rails/sprockets#749 |
Unable to reproduce on latest Rails and latest dependencies against a new stock app. |
@dhh this is easily reproducible with the latest stable Rails release (7.0.7):
|
I had missed this was a specific issue with turning off assets digest. Why are folks doing that? Keeping those digests in development is the preferred approach. But I'll reopen anyway. |
@dhh personally I never do it, but I was having some trouble with assets recompilation in development, and one of the suggested solutions was to set this in
This is how I stumbled upon this issue. |
I was turning it off because of this issue with livereload: guard/guard-livereload#169 (comment) |
@dhh, I also got bitten by this when used together with guard/guard-livereload#169 (comment). Live reloading is wonderful together with Tailwind, makes designing directly in the browser so quick that I've stopped using Figma. However, setting up live reloading in Rails is usually a hassle. Have used chokidar with node earlier, and now using guard + rack-livereload. Neither option is as simple as it should be. Would be great to have a canonical and easy way to get it working on a new rails app without lot's of tricky dependencies. |
When turning the asset digests off (https://guides.rubyonrails.org/asset_pipeline.html#turning-digests-off) in the development environment by setting
config.assets.digest
tofalse
inconfig/environments/development.rb
the fileassets/stimulus-loading.js
will not load and you will get an HTTP 404 for that file:Changing
config/importmap.rb
to pin tostimulus-loading
instead ofstimulus-loading.js
will make it work in the environments where the asset digests are turned off, the file will then however not be included in the production assets when precompiling them.I have created a new Rails app where you can reproduce this issue here: https://github.com/mrkcor/stimulus-loading-issue
For anyone looking for a workaround for this issue: you can put a copy of the file
stimulus-loading.js
invendor/javascript
and pin the file as is indicated in the README.The text was updated successfully, but these errors were encountered: