I wanna import sass in my react-app, I follow the user guide and found if I don't new a .scss file in project, npm start will cause wrong.
See original GitHub issueDescription
I follow the user guide, wanna import sass in my project. After I change the npm scripts settings in package.json, I didn’t new a .scss file in my project. Then npm start
caused error.
> react-list@0.1.0 build-css /Users/tom/Work/React/react-list
> node-sass-chokidar --include-path ./src --include-path ./node_modules src/ -o src/
No input file was found.
npm ERR! Darwin 16.6.0
npm ERR! argv "/usr/local/Cellar/node/7.5.0/bin/node" "/usr/local/bin/npm" "run" "build-css"
npm ERR! node v7.8.0
npm ERR! npm v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! react-list@0.1.0 build-css: `node-sass-chokidar --include-path ./src --include-path ./node_modules src/ -o src/`
But I new a .scss in src folder it works well. No errors anymore.
Expected behavior
I wanna even if I don’t new a .scss file then npm start
won’t cause wrong.
Environment
As the wrong info shows.
Then, specify:
- Operating system:
- Browser and version:
Mac OSX
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
javascript - How to fix this issue with Sass in my React project?
Solved by installing sass loader this way yarn add -D sass-loader sass webpack and the matching webpack version. This is the actual package....
Read more >Adding a Sass Stylesheet - Create React App
You can, however, integrate a CSS preprocessor if you find it valuable. To use Sass, first install sass : $ npm install sass...
Read more >How to Use Sass in React - MakeUseOf
You can start using Sass in React by installing the sass package via npm or yarn, updating your CSS files to .scss or...
Read more >Create-React-app: Features, Advantages, Steps to Build
In this tutorial, you will learn how to create a React application. Creating a React app often involves the integration of many dependencies ......
Read more >mini-css-extract-plugin - npm
extracts CSS into separate files. Latest version: 2.7.2, last published: 22 days ago. Start using mini-css-extract-plugin in your project by ...
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 FreeTop 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
Top GitHub Comments
@TomIsion I have raised this issue with node-sass-chokidar. You can find it here
I am able to reproduce the issue, basically when there are no
.scss
files in the./src
folder the command you are running will throw a warning saying there are no input files, but then also throws an npm error. I’m assuming the behavior you were expecting was to get the warning without the npm error. I should be able to fix this this weekend, thanks for reporting this.Awesome, thanks for followup!