solidus
solidus copied to clipboard
Solidus favicon overrides custom favicon using Sprockets 4
After upgrading to Sprockets 4, the Solidus favicon has effectively replaced our custom favicon.
Solidus Version: 2.9
To Reproduce
- Copy a custom favicon to
app/assets/images/favicon.ico
- Include this icon in a view with
<%= favicon_link_tag 'favicon.ico' %>
- Pre-compile assets with
rake assets:precompile
- Note that 2 favicon files are placed in
public/assets
, one from Solidus and the other being our custom icon. Each has a different fingerprint appended to the file name. - Open the view in a browser. The Solidus favicon is used.
Current behavior The Solidus favicon is displayed instead of our custom favicon.
Expected behavior
Any custom favicon at app/assets/images/favicon.ico
should be displayed, overriding the Solidus favicon that lives in the solidus_frontend
and solidus_backend
gems.
Desktop (please complete the following information):
- OS: macOS Catalina 10.15.3
- Browser: Chrome 79.0.3945.130
Additional context
This seems to be a problem with Solidus interacting with Sprockets 4. Anecdotal reports from Slack suggest this problem does not occur with Sprockets 3, and indeed this problem didn't surface for us until we upgraded to Sprockets 4 and app/assets/config/manifest.js
We can get around the problem by moving our favicon into a subfolder (app/assets/images/icons/favicon.ico
) and updating the reference in our view (<%= favicon_link_tag 'icons/favicon.ico' %>
) but this is sub-optimal. Images from Solidus should not be overriding our own images when placed at the same path.
@MFRWDesign Looks like it's a known issue from recent versions of solidus.