Skip to content

Bootstrap's sass is not working with new r2.0.0-next.66cc7a90 (with opt-in sass) #4363

Closed
@woile

Description

@woile

Is this a bug report?

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

Environment

  1. node -v: 8.9.1
  2. yarn --version (if you use Yarn): 1.6.0
  3. npm ls react-scripts (if you haven’t ejected): r2.0.0-next.66cc7a90
  4. Operating system: debian sid amd64

Steps to Reproduce

  1. npx create-react-app myapp --scripts-version react-scripts@2.0.0-next.66cc7a90
  2. rename index.css to index.scss
  3. update index.js to point to index.scss
  4. yarn add bootstrap
  5. open index.scss and add at the bottom @import "~bootstrap/scss/bootstrap.scss";
  6. yarn && yarn start

Expected Behavior

No error is shown.

Actual Behavior

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)

More info

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!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions