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.

Importing bootstrap.scss breaks SASS compilation

See original GitHub issue
  • Operating system and version: WIndows 10
  • Browser and version: Chrome 93
  • Suggested fix: Use math.max() instead of max().

I have create-react-app project (react-scripts@4.0.3). It works if I do npm start, but not when npm run build. This error occurs if you’re using Dart SASS 1.40.0 and higher.

SassError: 0.2rem and 0 are incompatible.
  ╷
9 │       $return: append($return, max($value, 0));
  │                                    ^^^^^^ 0.2rem
  │                                            ━ 0
  ╵
  node_modules\bootstrap\scss\mixins\_border-radius.scss 9:36   valid-radius()
  node_modules\bootstrap\scss\mixins\_border-radius.scss 20:20  border-radius()
  node_modules\bootstrap\scss\_reboot.scss 322:3                @import
  node_modules\bootstrap\scss\bootstrap.scss 17:9               @use
  src\styles\custom.scss 1:1                                    @use
  src\styles\index.scss 1:1                                     root stylesheet

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:13 (1 by maintainers)

github_iconTop GitHub Comments

17reactions
baijifeilongcommented, Sep 26, 2021

Uninstall sass, install node-sass.

11reactions
kris2kriscommented, Sep 21, 2021

It seems like SASS fixed it in the latest version (1.42.0) Checked locally, it really works now

For me it does not work with 1.42.0, 1.39.2 is the last version I can use.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Importing Bootstrap 4 variables.scss breaks Angular 6 ...
Whenever I try to @import '~bootstrap/scss/_variables.scss'; from within a component's scss file, the compilation breaks and I am getting ...
Read more >
Sass · Bootstrap v5.0
In your custom.scss , you'll import Bootstrap's source Sass files. You have two options: include all of Bootstrap, or pick the parts you...
Read more >
error compiling scss with node, cant reference bootstrap files
i think it wants to use sass and scss and compile them as there used to be a folder for each ... node_modules\bootstrap\scss\_variables.scss...
Read more >
How to customize Bootstrap 4 using Sass
The bootstrap.scss file contains what .scss files need to be compiled. If you have a look into that file you will see a...
Read more >
sass-loader - webpack - JS.ORG
Thus you can import your Sass modules from node_modules . ... Webpack needs to distinguish between bootstrap and ~bootstrap because CSS and Sass...
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