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
Importing bootstrap.scss breaks SASS compilation #35018
Comments
That error was supposedly resolved in 1.40.1. However, while that particular error has been resolved, something else within the Bootstrap partials results in a build fail across the following versions – when using CRA.
Dropping Sass back to 1.39.2 means it works again.
// index.scss
@import "bootstrap/scss/bootstrap"; {
"name": "bootstrap-cra-test",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"bootstrap": "5.1.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-scripts": "4.0.3",
"web-vitals": "^1.0.1"
},
"devDependencies": {
"sass": "1.42.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
|
I performed a binary search (of sorts) on the various Bootstrap partials. I believe it is If /*!
* Bootstrap v5.1.1 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors
* Copyright 2011-2021 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
// scss-docs-start import-stack
// Configuration
@import "functions";
@import "variables";
@import "mixins";
@import "utilities";
// Layout & components
@import "root";
@import "reboot";
@import "type";
@import "images";
@import "containers";
// @import "grid";
@import "tables";
@import "forms";
@import "buttons";
@import "transitions";
@import "dropdown";
@import "button-group";
@import "nav";
@import "navbar";
@import "card";
@import "accordion";
@import "breadcrumb";
@import "pagination";
@import "badge";
@import "alert";
@import "progress";
@import "list-group";
@import "close";
@import "toasts";
@import "modal";
@import "tooltip";
@import "popover";
@import "carousel";
@import "spinners";
@import "offcanvas";
@import "placeholders";
// Helpers
@import "helpers";
// Utilities
@import "utilities/api";
// scss-docs-end import-stack … it compiles successfully:
|
Narrowed it down to here: Lines 5 to 13 in 60d3eb3
… from where it appears to be |
Hello, I have created a ticket in sass (I don't know if it is correct) because I have identified the problem |
Great work @kris2kris ! |
Per @kris2kris, this is the multiplication which Sass is balking at now: bootstrap/scss/mixins/_grid.scss Lines 10 to 12 in 60d3eb3
From the release notes for 1.40.0
|
I think what makes this gnarlier to suss out is that a basic set-up compiles with no errors thrown: {
"name": "bootstrap-test",
"version": "1.0.0",
"description": "",
"scripts": {
"start": "npx sass style.scss style.css --load-path=node_modules"
},
"author": "",
"license": "ISC",
"devDependencies": {
"sass": "1.42.0"
},
"dependencies": {
"bootstrap": "5.1.1"
}
} // style.scss
@import "bootstrap/scss/bootstrap"; |
Still researching, but it could be because of sass-loader that |
For me it does not work with 1.42.0, 1.39.2 is the last version I can use. |
@kris2kris so great . nice for the success |
Uninstall |
On the GitHub page of node-sass it's written than node-sass is deprecated and to use dart-sass instead |
This is an issue with postcss-values-parser, see shellscape/postcss-values-parser#138. We have a #35033 which is supposed to work around the issue. |
math.max()
instead ofmax()
.I have create-react-app project (react-scripts@4.0.3). It works if I do
npm start
, but not whennpm run build
.This error occurs if you're using Dart SASS 1.40.0 and higher.
The text was updated successfully, but these errors were encountered: