question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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 issue

Description

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:

  1. Operating system:
  2. Browser and version:

Mac OSX

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
michaelwaymancommented, May 27, 2017

@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.

0reactions
gaearoncommented, May 27, 2017

Awesome, thanks for followup!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found