polymer-rails icon indicating copy to clipboard operation
polymer-rails copied to clipboard

Error compiling assets

Open maca opened this issue 10 years ago • 10 comments

I am using paper elements installed through bower in vendor/assets/components. I've overriden paper-styles by cloning the repo as app/assets/components/paper-styles. Everything works fine in development but the assets wont compile in production.

 remote:        Sass::SyntaxError: Invalid CSS after "  @apply": expected "}", was "(--layout-scroll);"
 remote:        (in /tmp/build_cdd01b23e7c8daee3206bba40023a2e5/vendor/assets/components/paper-dialog/paper-dialog.html)

Apparently sass is processing the files.

maca avatar Jun 09 '15 23:06 maca

Does this have anything to do with https://github.com/PolymerElements/paper-drawer-panel/issues/74 ?

nonameolsson avatar Jun 24 '15 09:06 nonameolsson

I am getting the same issue, it seems that Sass doesn't like that @apply statement.

Vortex avatar Jun 30 '15 22:06 Vortex

So Polymer isn't compatible with Sass at all at the moment?

nonameolsson avatar Jul 02 '15 10:07 nonameolsson

Yeah, @apply which is known as experimental extension isn't likely to be supported by sass.

alchaplinsky avatar Jul 02 '15 13:07 alchaplinsky

Solution? Why are the css files run through sass at all?

Vortex avatar Jul 03 '15 17:07 Vortex

Any progress on this at all?

npezza93 avatar Jul 18 '15 17:07 npezza93

@Vortex because rails minifies your css for production and for this purpose uses sass - config.assets.css_compressor = :sass

alchaplinsky avatar Jul 22 '15 19:07 alchaplinsky

@npezza93 If sass maintainers would decide to support experimental syntax from polymer team..

alchaplinsky avatar Jul 22 '15 19:07 alchaplinsky

Okey.. So I created a new rails app and installed everything in order from scratch. It worked! After that I removed everything from the other app I tried to use before. Now it works!

I have no idea, but Sass doesn't seem complain about the @apply anymore.

nonameolsson avatar Jul 25 '15 15:07 nonameolsson

@nonameolsson can you post your gem versions? I have

gem 'polymer-rails'

group :assets do
  gem 'sass', '3.4.19'
  gem 'sass-rails', '5.0.4'
  gem 'sprockets', '3.4.0'
  gem 'sprockets-rails', '3.0.0.beta2', :require => 'sprockets/railtie'
end

Frexuz avatar Nov 01 '15 22:11 Frexuz