Doubt it, but it might be interesting to know, due to the fact that bootstrap is recommended in the README, and bootstrap itself recommends using sass for its full potential
Relates to #3815
node -v: 8.9.1yarn --version (if you use Yarn): 1.6.0npm ls react-scripts (if you haven鈥檛 ejected): r2.0.0-next.66cc7a90debian sid amd64npx create-react-app myapp --scripts-version [email protected]index.css to index.scssindex.js to point to index.scssyarn add bootstrapindex.scss and add at the bottom @import "~bootstrap/scss/bootstrap.scss";yarn && yarn startNo error is shown.
This error appears:
./src/index.scss
Module build failed:
module.exports = require('./lib/node-progress');
^
Invalid CSS after "m": expected 1 selector or at-rule, was "module.exports = re"
in bla/bla/bla/node_modules/progress/index.js (line 1, column 1)
According to bootstrap:
For Bootstrap to compile, make sure you install and use the required loaders: sass-loader, postcss-loader with Autoprefixer
I think those loaders are missing, does anyone know if there's an easy way to add them without ejecting?
I hope to be helpful,
Thanks to everyone!
Same here.
node 8.9.1
npm 6.0.0
react-scripts 2.0.0-next.66cc7a90
osx 10.13.4
I'm getting the same error. Deleting @import progress from node_modules/bootstrap/scss/bootstrap.scss fixed the problem. The file being imported is javascript, but I think is being read as CSS.
Thanks for supporting sass and looking forward to a solution!
I think this is related to https://github.com/webpack-contrib/sass-loader/issues/556
For me it happenend when I had a npm package with the same name as a sass file I was trying to import from node_modules.
AFAIK [email protected] solves this problem.
Does someone want to submit a PR to update sass-loader? It would be nice to add a test for this case as well.
Just tested cra@2-beta + eject + [email protected]
Problem gone
Before we close this, worth keeping an eye on https://github.com/webpack-contrib/sass-loader/issues/556#issuecomment-384264549.
I merged the PR updating sass-loader to 7.0.1 but I'll leave this issue open for the time being.
Could the fixed alpha version be deployed to npm?
add ``import 'bootstrap/dist/js/bootstrap.bundle.min'; to your route index.js
This is working in v2 beta. We don't use the options linked in above issue -- not sure this is worth keeping open unless someone can formulate a better proposal on what we need to keep an eye out for or do.
Most helpful comment
Could the fixed alpha version be deployed to npm?