-
Notifications
You must be signed in to change notification settings - Fork 97
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
Raising an error when an asset is not found #127
Comments
It's worth noting that propshaft already does raise a propshaft/lib/propshaft/helper.rb Lines 3 to 5 in 62476fa
The code linked in @tiagobabo's post is specific to assets that are referenced in a Note, however, that some expressions inside I do see the value in adding such a configuration to throw an exception rather than just logging a warning if an asset inside |
You're right, this only happens for assets required inside |
My original implementation was for a Is there a reason why raising would be better? I'm asking because between our two experiences we might figure out a third option that might be better than logging/raising |
I’ll close this issue for now as it’s not a bug but a feature request, and from my experience logging provides a better workflow than raising. If anyone has further input, feel free to comment. |
As per the Rails docs, if one is using sprockets-rails >= 3.2.0 it's possible to set
config.assets.unknown_asset_fallback = false
and raise an error when an asset is not found. Looking at the current implementation ofasset_url
we get a warning if propshaft is unable to resolve an asset URL. Would it be possible to have a similar configuration that would allow raising an error instead (especially onassets:precompile
)?The text was updated successfully, but these errors were encountered: