Skip to content
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

Asset Pipeline Could Not Find Stylesheet #45

Closed
jaymiejones86 opened this issue Aug 11, 2015 · 11 comments
Closed

Asset Pipeline Could Not Find Stylesheet #45

jaymiejones86 opened this issue Aug 11, 2015 · 11 comments
Assignees

Comments

@jaymiejones86
Copy link

I am using the automatic processing of emails in a Rails 4.2.3 app and am running into the following issue (note, I have seen similar issues but I think mine may be slightly different):

JobNotifier#job_closed_notification: processed outbound mail in 50.1ms
Performed ActionMailer::DeliveryJob from Inline(mailers) in 60.06ms
Roadie::CssNotFound: Could not find stylesheet "/assets/email.self-4e2f05105e9cb156e618b1a28f953e1e201a4200fdad37ab0658af40d798c045.css?body=1"
Used provider:
ProviderList: [
        #<Roadie::Rails::AssetPipelineProvider:0x007fd8a9e0dbc8>
]

This error is happening in production and development, it seems the hash is different.
In development when I compile the assets, the path is right but the hash is different.

/assets/email-4e2f05105e9cb156e618b1a28f953e1e201a4200fdad37ab0658af40d798c045.css

Notice how self is in the version by roadie?

The email stylesheet is being loaded in at:

Rails.application.config.assets.precompile += %w( email.css )
@jaymiejones86
Copy link
Author

The console output was pretty much spot on to the console output in #42

@Mange
Copy link
Owner

Mange commented Aug 11, 2015

Can you verify the HTML output? Add a Roadie::NullProvider to the provider list and check out the resulting email. Could it be that your views are adding this .self for some reason?

@Mange Mange self-assigned this Aug 11, 2015
@jaymiejones86
Copy link
Author

Sorry @Mange this looks like a serious case of Gremlins.
Did not touch any code and now it is all working after leaving it overnight.

VERY BIZARRE.

@Mange
Copy link
Owner

Mange commented Aug 12, 2015

I'm glad it worked our for you. ☺

ons 12 aug 2015 04:59 Jaymie Jones notifications@github.com skrev:

Closed #45 #45.


Reply to this email directly or view it on GitHub
#45 (comment).

@saten
Copy link

saten commented Jan 27, 2016

having the same issue here
Roadie::ProvidersFailed - Could not find stylesheet "/assets/mail.self-ec2278f...."

if I remove the require_self line in mail.css the errors move on the next require line.

@thermistor
Copy link

I was also having a similar problem:

2016-03-12T06:44:49.766Z 7346 TID-oxvpg3h3s WARN: Roadie::CssNotFound: Could not find stylesheet "/assets/email.self-695a130fdb2923902b47f8c8847c18ef281ee06750a0795d9275b8fbf8400dbb.css?body=1"
Used provider:
ProviderList: [
  #<Roadie::FilesystemProvider:0x007ffcb29776b8>
]

I traced it to updating sass-rails from 4.0.5 to 5.0.4 (sass-rails 5.0.4 brings in a much newer sprockets as well), reverting sass-rails to 4.0.5 fixed the issue for me.

@Mange
Copy link
Owner

Mange commented Mar 12, 2016

This is clearly something I need to investigate now.

Thanks for the extra details!

Den lör 12 mars 2016 08:42Weston Triemstra notifications@github.com skrev:

I was also having a similar problem:

2016-03-12T06:44:49.766Z 7346 TID-oxvpg3h3s WARN: Roadie::CssNotFound: Could not find stylesheet "/assets/email.self-695a130fdb2923902b47f8c8847c18ef281ee06750a0795d9275b8fbf8400dbb.css?body=1"
Used provider:
ProviderList: [
#Roadie::FilesystemProvider:0x007ffcb29776b8
]

I traced it to updating sass-rails from 4.0.5 to 5.0.4 (sass-rails 5.0.4
brings in a much newer sprockets as well), reverting sass-rails to 4.0.5
fixed the issue for me.


Reply to this email directly or view it on GitHub
#45 (comment).

@jufemaiz
Copy link

jufemaiz commented Jun 22, 2016

Can confirm this one too.

Should specs be using compiled assets?

@ryankc33
Copy link

ryankc33 commented Aug 18, 2016

Running into this problem too. Seems that Roadie is looking for precompiled assets in the test environment.

@Hamdan85
Copy link

Hamdan85 commented Apr 3, 2020

that was any development in this matter? I'm experiencing the issue.

@Mange
Copy link
Owner

Mange commented Apr 5, 2020

Sorry, I forgot about this. Since the gem is now in passive maintenance mode, I'm waiting for someone else to find the cause and propose a fix.

I'm not using this gem myself, and in the Rails app I'm currently passively maintaining, we don't use the asset pipeline anyway.

The issue seems to be how the gem tries to auto-detect that asset pipeline is enabled before it adds the provider for live-compiled assets. That probably fails because some option was moved around, which makes it only pick the pre-compiled assets provider.

Worst-case, you could just manually add the right provider in your config and stop relying on the auto-detection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants