Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't seem to compile new files? #21

Closed
JemarJones opened this issue Aug 30, 2017 · 8 comments
Closed

Doesn't seem to compile new files? #21

JemarJones opened this issue Aug 30, 2017 · 8 comments

Comments

@JemarJones
Copy link

When running this with the recommended command from create-react-app,

    "build-css": "node-sass-chokidar src/ -o src/",
    "watch-css": "npm run build-css && node-sass-chokidar src/ -o src/ --watch --recursive",

, it doesn't seem to notice and compile newly created scss files. I have to cancel and re-run the command to get new files compiled.

@michaelwayman
Copy link
Owner

I'm pretty sure it does.. Can you please attach a VERY SMALL example project that duplicates your issue and include info such as (operating system, node version, node-sass-chokidar version, etc)

@michaelwayman
Copy link
Owner

Can you please share the version you are using, system you are on, and steps to reproduce?
It would go a long way to helping me resolve this.

@PaulRBerg
Copy link

PaulRBerg commented Nov 10, 2017

Indeed, it doesn't compile new files. I'm afraid I cannot share my code, but I'm running Sierra 10.12.6 and I use yarn start. I've tried with npm and the result is the same.

I've followed the instruction provided by create-react-app.

UPDATE I think I found a pattern. Whenever I have some warnings, the edited files aren't compiled. Could you investigate this?

UPDATE#2 I eventually found the issue and it was related to a missing space between commands.

@GreenAsJade
Copy link

Is there some reason why the watch command has --recursive whereas the build one doesn't have --recursive?

@michaelwayman
Copy link
Owner

@GreenAsJade --recursive doesn't actually do anything and has been removed.

Also, sorry for the delay, but I just published version 1.0.0 and this should be fixed now.

Also, @JemarJones when you use the --watch option all the files are built at the beginning so you shouldn't need to
"watch-css": "npm run build-css && node-sass-chokidar src/ -o src/ --watch --recursive",
instead you should be able to just do
"watch-css": "npm run node-sass-chokidar src/ -o src/ --watch",

@lmorchard
Copy link

FWIW, I have this issue too. On Windows, using node-sass-chokidar v1.3.3. I have a watch:css script in my package.json like this:

    "watch:css": "node-sass-chokidar src/ -o src/ --watch"

But, when I add a new .scss file somewhere under src/ - it never gets picked up for processing until I stop the process and re-run it. From then on, changes are picked up.

@jozefmery
Copy link

Same behavior as Imorchard described, same setup, doesn't work.

@kylebebak
Copy link

kylebebak commented Nov 1, 2018

I don't know how node-sass-chokidar works, but if it's just a wrapper around node-sass, perhaps this issue is related to sass/node-sass#1891.

The node-sass issue, although it was closed, seems to never have been fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants