question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SCSS compiling error - Invalid CSS after

See original GitHub issue

Bug reports must include:

Operating system and version (Windows, macOS, Android, iOS)

macOS Big Sur - Version 11.2.1

Browser and version (Chrome, Firefox, Safari, Microsoft Edge, Opera, Android Browser)

The issue is not browser-specific

A reduced test case or suggested fix using CodePen or JS Bin

I have installed bootstrap using node. npm i bootstrap@next and imported bootstrap.scss into my custom stylesheet to customize. styles.scss

When I try to compile it gives the following kind of errors

error scss/styles.scss (Line 9 of node_modules/bootstrap/scss/mixins/_table-variants.scss: Invalid CSS after "... #{$background}": expected "{", was ";")

I have also posted a question on the StackOverflow https://stackoverflow.com/questions/66148648/bootstrap-5-beta-scss-compiling-error-invalid-css

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
loopy3025commented, Apr 20, 2022

I’m getting this error with

  • node-sass 7.0.1
  • grunt 1.5.2
  • grunt-sass 3.1.0

Which are all fairly recent.

Am I missing a dependency?

Running "sass:dist" (sass) task
Fatal error: Error: Invalid CSS after "...     floor(math": expected expression (e.g. 1px, bold), was ".div($grid-gutter-w"
        on line 369 of node_modules/bootstrap-sass/assets/stylesheets/bootstrap/_variables.scss
        from line 8 of node_modules/bootstrap-sass/assets/stylesheets/_bootstrap.scss
        from line 2 of scss/style.scss
>> vbar-padding-horizontal:        floor(math.div($grid-gutter-width, 2)) !defa
   ------------------------------------------^

I’ve also attempted switching from node-sass to dart-sass and I get the same error, just formatted nicer.


Fatal error: Error: Undefined function.
    ╷
369 │ $navbar-padding-horizontal:        floor(math.div($grid-gutter-width, 2)) !default;
    │                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ╵
  node_modules/bootstrap-sass/assets/stylesheets/bootstrap/_variables.scss 369:42  @import
  node_modules/bootstrap-sass/assets/stylesheets/_bootstrap.scss 8:9               @import
  scss/style.scss 2:9                                                              root stylesheet

However, that is with dart-sass 1.25.0. npm doesn’t think that 1.32.11 exists.

Rolling back to bootstrap-sass 3.3.7 solves it for now.

2reactions
akuma6099commented, Apr 23, 2021

Just wanted to confirm it is a sass/scss compiler issue. I had “Sass 3.4.23 (Selective Steve)” from “apt-get install ruby-sass”. Had to remove it and grab the latest Dart Sass 1.32.11 @ https://github.com/sass/dart-sass/releases/tag/1.32.11

Problem solved.

Read more comments on GitHub >

github_iconTop Results From Across the Web

SASS Error : Invalid CSS after " expected pseudoclass or ...
The Compiler interpretes "margin:" as element ( <margin></margin> ) because after the colon is no space and thefor tries to handle it as...
Read more >
"Error: Invalid CSS after" while compiling theme - Drupal
Problem/Motivation When trying to compile the theme, custom droopler_theme gives error. Please note that compiling breaks/stops.
Read more >
Resolve the "Sass::SyntaxError: Invalid CSS" error in Liferay 6.1
Issue: Liferay 6.1 uses the dynamic CSS filter to parse Sass CSS. The dynamic CSS filter will validate the SASS/CSS and compile the...
Read more >
Error: Invalid CSS after (node-sass) - BigCommerce Support
error editing/preview theme locally using Stencil CLI - Error: Invalid CSS after (node-sass). Hi,. I've installed a theme "roots theme" and ...
Read more >
Npm run compile:sass error - The freeCodeCamp Forum
“formatted”: “Error: Invalid CSS after “ck”: expected “{”, was “”\n on line 2 of sass/abstracts/_mixins.scss\n from line 1 of ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found