-
-
Notifications
You must be signed in to change notification settings - Fork 79k
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
React Build Fails with 5.2 #36851
Comments
Same problems like @pipe2k27 when I cloned my repo from another computer. I rolled back to v5.1.3 too and the build runs fine. EDITED Import trace for requested module:
./styles/globals.scss
./pages/_app.tsx
./styles/globals.scss
SassError: Undefined variable.
╷
142 │ values: $utilities-border-colors
│ ^^^^^^^^^^^^^^^^^^^^^^^^ The variable globals.scss @import "bootstrap/scss/functions";
$primary: #d4262f;
@import "bootstrap/scss/variables";
$table-hover-bg: rgba($primary, $table-hover-bg-factor);
@import "bootstrap/scss/mixins";
@import "bootstrap/scss/utilities";
$colors: map-remove($colors, "blue", "indigo", "purple", "pink", "red", "orange", "yellow", "green", "teal", "cyan");
$theme-colors: map-remove($theme-colors, "info", "warning", "success", "danger", "secondary");
@import "bootstrap/scss/root";
@import "bootstrap/scss/reboot";
@import "bootstrap/scss/type";
@import "bootstrap/scss/containers";
@import "bootstrap/scss/grid";
@import "bootstrap/scss/transitions";
@import "bootstrap/scss/nav";
@import "bootstrap/scss/navbar";
@import "bootstrap/scss/buttons";
@import "bootstrap/scss/card";
@import "bootstrap/scss/tables";
@import "bootstrap/scss/helpers/position";
@import "bootstrap/scss/utilities/api";
// @import "bootstrap" |
You have to include the new maps.scss file. See the blog post for details: https://blog.getbootstrap.com/2022/07/19/bootstrap-5-2-0/. |
Even after adding maps.scss, I'm getting These are the culprits
Below is custom.scss
|
I'm seeing the same thing as @ahmadasjad so I'm not sure why this is closed. I'm not doing any custom imports, just |
Any chance someone can create a live example in Stackblitz that we could test with? I'm on vacation and don't have time to do this myself. |
My 2 cents. I have the same problem using CRA 4.0.3 + Dart-SASS 1.54.4 for Bootstrap 5.2. Seems that is related to following issue bootstrap 1496. Bootstrap 5.1.2 has introduce workounds here but Bootstrap 5.2 has not (like here). When I remove such SASS lines, I have no more parser errors. |
@afrz is this problem only related to In other word, does it compile if the multiplication is left as-is in rules like bootstrap/scss/_accordion.scss Line 50 in 337068f
|
Still having the issue. Maps import did not solve. only downgrading to 5.1.3 will make build pass. |
We do have a custonBootstrap file where we override default bootstrap and that seems to be the issue. whenever you try to import @import '../../../node_modules/bootstrap/scss/bootstrap'; build will fail |
|
postcss-values-parser returns a syntax error when a negative value is provided in a `calc` function after a CSS variable. This is not an issue with Bootstrap itself, but a workaround to allow projects using postcss-values-parser to keep upgrading and compiling bootstrap Ref: shellscape/postcss-values-parser#138, twbs#35033 Fix: twbs#36851
Hi, I have a reproducible (not-so-reduced) test case $ gem install rails -v 6.1.6.1 # If Rails 6.x is not installed. sudo may be needed
$ rails _6.1.6.1_ new syntax-error-webpacker --skip-active-record --skip-javascript # Any 6.1.x will work
$ cd syntax-error-webpacker/
$ echo "{ \"private\": true }" > package.json
$ echo "gem 'webpacker', '5.4.3'" >> Gemfile
$ bundle
$ bundle exec rails webpacker:install
$ yarn add bootstrap @popperjs/core
$ echo "@import \"~bootstrap/scss/bootstrap\";" > app/javascript/packs/application.scss
$ NODE_ENV=production bin/webpack # does not happen in development Output:
A draft PR to workaround this issue is available at #37079, but this probably needs a sort of check to prevent addition of new calculations that break postcss-values-parser |
For future self, need to I confirm that the issue shown in the reproductible steps and that the draft PR fix the compilation (thanks a lot @tagliala for that) so @mdo I'm reopening the issue for further investigations; I need to check why we rollbacked the inversion of negative value multipicators in |
Welcome!
Will fix instructions
Don't know if it is a rollback. Some values are still inverted in v5.2.0 as pointed out in #36851 (comment) bootstrap/scss/mixins/_grid.scss Lines 11 to 13 in edf9c40
I wonder why if a custom linter can be implemented to prevent this issue to come back in the future |
Some modifications linked to the errors in the history: As you said @tagliala it doesn't seem to be a rollback but rather something we have forgotten along the way or we weren't aware of (authors/reviewers of PRs).
Would be great indeed to avoid reintroducing issues that we can't be aware of with our current CI. I don't have any ideas atm on how to do that. Feel free to propose something if you have any idea :) |
As far as I can tell, I think this has been involuntarily introduced in 5.2.0 because of the migration to CSS variables. Example from #34622
I only have in mind a regular expression and that is definitely a bad idea prone to false positives :( |
No as you figure it out already I guess :)
Yes, it seems the problem is combining Edited : I just saw the PR : Good job 🥇 |
postcss-values-parser returns a syntax error when a negative value is provided in a `calc` function after a CSS variable. This is not an issue with Bootstrap itself, but a workaround to allow projects using postcss-values-parser to keep upgrading and compiling bootstrap Ref: shellscape/postcss-values-parser#138, #35033 Fix: #36851
This issue has been solved with 5.2.1 Thanks everyone for support and help! much appreciated! |
This is still happening on |
Hi @kevinhq, I can't confirm
Output:
I've also a repository that works (but I cannot test on heroku at the moment) https://github.com/diowa/ruby3-rails7-bootstrap-heroku |
@tagliala no worry. I just tried this one, and it works. Thanks. |
Prerequisites
Describe the issue
React Build Fails when using bootstrap 5.2 and trying to parse SCSS files. Rolled back to 5.1.3 version and build runs fine.
Console shows parserError: Syntax error but nothing is wrong with the file. When running the project locally it is fine too! Just trying to build breaks the code.
Any help or insight will be appreciated
Thank you very much!!
Reduced test cases
What operating system(s) are you seeing the problem on?
Linux
What browser(s) are you seeing the problem on?
Chrome
What version of Bootstrap are you using?
v5.2.0
The text was updated successfully, but these errors were encountered: