0

I'm trying to precompile assets in production. But I'm getting an error when including the file below.

bootstrap_style.sass

@import bootstrap
a
  color: #6b9029

application.css

/*
*= require_self
*= require jquery-ui
*= require prettyPhoto.css
*= require prettyLoader.css
*= require prettyPopin.css
*= require prettyPhoto.css
*= require sass/main
*= require sass/master
*= require sass/ie
*= require sass/ie8
*= require sass/buy_now
*= require sass/ssl_seal
*= require font-awesome
*/

/*
TODO: I had to remove the site report from the main import here.
This will need to be added back and loaded only on the site report page only
or figure out why the styles are conflicting with the main layout
require sass/site_report
*/

error

rake aborted!
Sass::SyntaxError: Invalid CSS after "...lor}: #{$value}": expected "{", was ";"
/var/lib/gems/2.6.0/gems/bootstrap-4.4.1/assets/stylesheets/bootstrap/_root.scss:5

updated error

SassC::SyntaxError: Error: Undefined operation: "prefix-usage(browser-prefixes(browsers()), css-boxshadow, (full-support: true), (partial-support: true)) gt 0.1".
        on line 324:7 of ../var/lib/gems/2.6.0/gems/compass-core-1.0.3/stylesheets/compass/_support.scss, in function `use-prefix`
        from line 208:33 of ../var/lib/gems/2.6.0/gems/compass-core-1.0.3/stylesheets/compass/_support.scss, in function `prefixes-for-capability`
        from line 218:40 of ../var/lib/gems/2.6.0/gems/compass-core-1.0.3/stylesheets/compass/_support.scss, in mixin `with-each-prefix`
        from line 360:12 of ../var/lib/gems/2.6.0/gems/compass-core-1.0.3/stylesheets/compass/_support.scss, in mixin `prefixed-properties`
        from line 43:12 of ../var/lib/gems/2.6.0/gems/compass-core-1.0.3/stylesheets/compass/css3/_box-shadow.scss, in mixin `box-shadow`
        from line 3902:12 of app/assets/stylesheets/sass/main.sass
>>   @if $usage > $threshold {

   ------^

main.sass

  @include box-shadow(0 0 1px 1px rgba(255, 255, 255, 0.4) inset)
Antarr Byrd
  • 24,863
  • 33
  • 100
  • 188

1 Answers1

1

You can check the syntax of your files by running sass -c app/assets/stylesheets. That might detect the issue for you.

You can also check this github reference #sass

/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *
 *= require jquery-ui
 *= require prettyPhoto.css
 *= require prettyLoader.css
 *= require prettyPopin.css
 *= require prettyPhoto.css
 *= require sass/main
 *= require sass/master
 *= require sass/ie
 *= require sass/ie8
 *= require sass/buy_now
 *= require sass/ssl_seal
 *= require font-awesome
 *= require_self
*/
code_aks
  • 1,972
  • 1
  • 12
  • 28
  • That helped me track one issue. But I'm getting this error now `Error: Invalid CSS after "...ain import here": expected expression (e.g. 1px, bold), was "." on line 18 of app/assets/stylesheets/application.css Use --trace for backtrace.` I will post the file above – Antarr Byrd Dec 31 '19 at 17:43
  • and removing the comment section of that file gives the error `Error: Invalid CSS after "*": expected selector, was "= require_self" on line 2 of app/assets/stylesheets/application.css` – Antarr Byrd Dec 31 '19 at 17:46
  • I edited my answer content can you please try now. :) – code_aks Dec 31 '19 at 17:54
  • I think you can use some online css validator tool to validate your CSS. – code_aks Dec 31 '19 at 18:10
  • Or Try this post :- https://stackoverflow.com/questions/25722267/rake-assetsprecompile-throws-sasssyntaxerror-invalid-css-after – code_aks Dec 31 '19 at 18:14
  • I'm getting a new error after changing from `sass-rails` to `sassc-rails` in Gemfile. I've added it above – Antarr Byrd Jan 02 '20 at 15:02