-
Notifications
You must be signed in to change notification settings - Fork 790
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
Image without extension works in Dev environment but raises error in Production #729
Comments
I tried to play with this a bit. I used your Rails and Ruby versions but didn't get the error that raised for you, i.e. In a development environment both of these work
In a production environment with
If I set
I've seen others file similar issues; I wasn't able to reproduce any of them. Maybe I'm missing something? |
Not sure if it could be because you are using both
I did some more research and found this is a known issue. |
The example given above may be stumbling over a separate issue, which is that the asset pipeline will change "jpeg" extensions into "jpg" extensions, and this will cause both calls to image_tag to fail. I whipped up a sample app with The root path renders a template with:
Run the app and visit the root path to see both images. Then in Bitten by this issue recently, would be great if this were consistent in development for everyone. |
This is a nasty bug that has affected us twice last year and took down Production.
I see a PR was submitted but never merged and there was no explanation if the PR was lacking in some way.
https://github.com/rails/sprockets-rails/pull/461/files
This is currently an issue in Rails: rails/rails#42784
Previous issue in Rails: rails/rails#35651
Expected behavior
If an image is missing extension in Development environment, it should raise
Sprockets::Rails::Helper::AssetNotFound
error.Actual behavior
If the image is missing extension in Development environment, it renders fine.
However, it raises
Sprockets::Rails::Helper::AssetNotFound
error in Production environment.System configuration
sprockets (4.0.2)
sprockets-rails (3.2.2)
Rails 6.0.3.4
ruby 2.7.2p137
Example App (Reproduction) - THIS IS IMPORTANT YOUR ISSUE LIKELY WILL NOT BE RESOLVED WITHOUT THIS
There was an example app provided.
https://github.com/gadikotamohan/image_test
rails/rails#35651 (comment)
A PR has already been created.
The text was updated successfully, but these errors were encountered: