ActionView::Template::Error uninitialized constant WickedPdf::WickedPdfHelper::Assets::SprocketsEnvironment::Sprockets
The v2.7.0 of wicked_pdf seems not to be fully incompatible with Rails 7. Rails 7.0 makes Sprockets an optional dependency. We don't use Sprockets in our Rails 7.1 app and updating wicked_pdf to v2.7.0 make us a bit of trouble.
There is a addition to WickedPdf::WickedPdfHelper::Assets#read_asset that makes the difference:
asset = find_asset(source)
Downgrading wicked_pdf back to v2.6.3 restored the functionality.
Our Rails 7.1 application just experienced the same constant error when dependabot updated our application to v2.8.0 from v.2.7.0. We are not using sprockets either.
Same problem in an application with Rails 6.1.7.7 deployed in Heroku. Downgrading from v2.8.0 to v2.7.0 made the trick.
Same error in one of our projects while upgrading to the version 2.8.0
Perhaps it could be related to: https://github.com/mileszs/wicked_pdf/issues/1117
Same problem with 2.8.0 here!