Can't run npm run build with react bootstrap + ts + sass
See original GitHub issueDescribe the bug
With the latest version, it is not possible to run the build script. It gives a syntax error (see screenshots). The mentioned line and column in the error is consistent irregardless of where the bootstrap import line is.
To Reproduce
Steps to reproduce the behavior:
# 1. Create a basic react typescript template
npx create-react-app my-app --template typescript
# 2. Install react-bootstrap, bootstrap and sass
npm install react-bootstrap@next bootstrap@5.1.0 sass
# 3. Change the template css to scss
mv src/App.css src/App.scss
# 4. Add @import "~bootstrap/scss/bootstrap"; to the top of App.scss
# 5. Change the import from css to scss in App.tsx
Reproducible Example
Cannot reproduce on CodeSandbox, since you can’t run builds there (or I’m blind)
Expected behavior
The build script to complete successfully and filling the build folder.
Screenshots
Environment (please complete the following information)
- Operating System: Windows, also tested on Debian Linux
- Browser: Irrelevant
- React-Bootstrap Version: 2.0.0-beta.6
Additional context
Tried talking about this in the Discord channel, at least one other user has the same issue.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:7 (2 by maintainers)
Top Results From Across the Web
'npm start' returns error: "There might be a problem with the ...
Try running npm ls webpack in your project folder. This will tell you which other package (apart from the expected react-scripts) installed ...
Read more >Getting Started with Bootstrap 5, React, and Sass - Designmodo
Installing Bootstrap 5. To use Bootstrap 5 with React JS, we need to install it via npm by running the command below on...
Read more >Webpack - Bootstrap
Install bootstrap as a Node.js module using npm. ... First, create your own _custom.scss and use it to override the built-in custom variables....
Read more >react-bootstrap - npm
Run the tests once with yarn test (Or run them in watch mode with yarn run tdd ). · Start a local copy...
Read more >joyson-react-typescript - npm package - Snyk
css to src/App.scss and run npm run watch-css . The watcher will find every Sass file in src subdirectories, and create a corresponding...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Bootstrap 5.1.2 has been released with the workaround
Seems like it’s caused by the margin values inside
make-row
inmixins/_grid.scss
.It’ll compile if I change this:
to this: