Open emirkin opened 3 years ago
Can you provide an example application that reproduce the issue?
Here you go. Open http://localhost:3000/login
@rafaelfranca , the reason exception is thrown is that sprockets-rails-3.2.2:lib/sprockets/railtie.rb
def asset_precompiled?(logical_path)
if precompiled_assets.include?(logical_path)
true
elsif !config.cache_classes
# Check to see if precompile list has been updated
precompiled_assets(true).include?(logical_path)
else
false
end
end
returns false.
My file is listed in the precompiled array but with a ".scss" extension (common/login.scss
), whereas the incoming logical path is ".css" (common/login.css
). That is why it cannot find it. Assuming the logical path is correct, I am not sure why the precompiled array holds it as scss (I was expecting the precompilation to yield a css). Any ideas?
btw: you already have common/login.scss
included in your layout by application.css
.
stylesheet_link_tag 'asset.scss'
used to work with the previous sprockets version. I'm not sure if it was internationally dropped or not, but now you need a css file for an endpoint and require all scss files into it. This way it works as expected.
I get AssetNotPrecompiled from the following code:
= stylesheet_link_tag 'common/login'
(in a file calledindex.haml
).Here's how my assets are configured:
My
app/assets/config/manifest.js
looks like this:System configuration