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

Rails 4 assets:precompile error #6820

Closed
JustSnow opened this issue Jun 24, 2015 · 6 comments
Closed

Rails 4 assets:precompile error #6820

JustSnow opened this issue Jun 24, 2015 · 6 comments

Comments

@JustSnow
Copy link

Hello. I'd got error when assets precompiled

Sass::SyntaxError: Invalid CSS after "": expected selector or at-rule, was "{"
  (in /vendor/assets/bower_components/fontawesome/css/font-awesome.css.map)
(sass):1

font awesome version 4.3.0
4.2.0 precompiled correct

@jywarren
Copy link

I'm getting this too on 4.5.0; font-awesome.css.map is a source map file, and the rails asset pipeline is trying to compile it as css. Trying to figure out how to prevent this. Some background here: http://stackoverflow.com/questions/21504611/what-are-the-map-files-used-for-in-bootstrap-3-1

@jywarren
Copy link

I'm going to try to explicitly set the preferred_syntax option to :sass as in https://github.com/rails/sass-rails to suppress this file from being parsed by Sass.

Hmm, that didn't work.

@jywarren
Copy link

Ok, a viable option for me was to disable sass. But obviously this is not easy for everyone. If there's a way to disable compiling of source map files, that'd be great. But should this even be in the packaged fontawesome? I don't see any reference to it, and it seems to have been added in an unrelated commit.

https://github.com/FortAwesome/Font-Awesome/commits/master/css/font-awesome.css.map

I'm going to open a new issue proposing that it be removed or ignored in bower.json, and at least see what people say.

@JustSnow
Copy link
Author

@jywarren thanks for your answer. I found solution like:

Rack::Mime::MIME_TYPES.merge!({".map" => "text/plain"})

It help me

@jywarren
Copy link

Thanks, @JustSnow, OK, I found here: emberjs/ember-rails#428 (comment) that the line you ref can be placed in config/initializers/rack.rb and that worked for me. Thanks!

@jywarren
Copy link

I think this can be closed!

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

No branches or pull requests

2 participants