inline_svg: 1.5.0 and 1.5.1 can no longer find assets in production
I am still debugging this, but I figured I’d open an issue earlier in case other people have the same problem.
We were previously using 1.4.0 with seemingly no issues, but on upgrading to 1.5.0 (or 1.5.1) we now get:
<!-- SVG file not found: 'logo-black.svg' -->
The corresponding view is pretty basic:
= inline_svg "logo-black.svg", class: "welcome-logo"
What’s extra strange is that this only appears when we’ve deployed to Heroku, not in local development.
Which version of Rails are you using?
Ruby 2.6.2, Rails 5.2.3
Are you using Webpack at all?
Yes, via webpacker
Are you using Sprockets or Webpacker? Or both?
Both
Are you using your own custom asset_finder?
No
Could you paste your InlineSvg.configure block, if any
Not using one.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 6
- Comments: 16 (6 by maintainers)
Thought I would chime in and see if a bit of extra info could help.
I am using Rails 6.0rc1 - Ruby 2.5.3 and inline_svg v1.5.2 and I am only using webpacker (no sprockets).
When I use the
InlineSvg::WebpackAssetFinderconfig, that finder only appears to find files that are precompiled (that is, I run$./bin/webpackbefore I start my server. If I do that, the finder find’s my files no problem. However, it does not appear to use any assets found viawebpack-dev-serveror update changes based on if I remove or add files to my images folder.This is the finder that I was using before (1.3) the 1.5.2 update:
and it still works fine with the 1.5.2 version plugin.
I’ve released v1.5.2, which completely reverts the automatic Webpacker detection and makes Webpack “opt-in” by default, meaning that if you’re using Sprockets to serve assets (either dynamically, or precompiled), there should be no additional configuration required.
Please update to this version and let me know if you have any problems. Sorry for all the trouble these last couple of releases have caused.