Skip to content

Chokidar matches .js files in symlinks #85

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

Closed
james-criscuolo opened this issue Jul 11, 2018 · 3 comments
Closed

Chokidar matches .js files in symlinks #85

james-criscuolo opened this issue Jul 11, 2018 · 3 comments

Comments

@james-criscuolo
Copy link

Nativescript 4.1.0
nativescript-dev-sass 1.6.0

After updating from 1.3.5, my application is running node-sass dozens of times when calling tns run (platform/arguments doesn't matter). Upon investigating, I found that the promise within watcher.js would back up due to this, and the application would refresh several times for no reason once the build was complete until it caught up.

Upon further investigation, I found that the chokidar watcher is firing for every .js (its a typescript/angular project) file I have in a symlinked set of folders. I cannot explain why this is happening, but there is an issue open with chokidar:

paulmillr/chokidar#729

While I'd prefer a solution where people could have css files in their symlinked files, I think the current behavior is worse than not allowing that. In watcher.js, adding this line to the watcherOptions:

followSymlinks: false,

solves the problem (I have no css in my symlinked files). I was going to create a .PR, but saw that there should be a corresponding issue first, and the other symlink issue was a bit different.

I can also investigate older versions of chokidar or other suggestions, the above was just the simplest to get my app back on track.

Thanks,
James

@endarova
Copy link
Contributor

Hi, we have released new version of the [email protected] plugin that should fix that faulty behavior. You can give it a try by executing npm i nativescript-dev-sass --save-dev in your project folder.

@james-criscuolo
Copy link
Author

I just tested and my issue still exists. I've been using a before-watchPatterns hook to leave out the bad files from being watched. Removing that hook and updating my version to 1.6.1 lead to the looping behavior again.

@endarova
Copy link
Contributor

endarova commented Feb 8, 2019

Hi @james-criscuolo , I am sorry to hear that the problem is not resolved on your side. Unfortunately, we cannot reproduce it, so it’s hard to investigate. I have created Angular project, symlinked some plugin directories and synced files without causing the described behavior. It would be great if you can provide us with more steps or sample project to reproduce it. I suggest you log another issue and provide the details there.

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

No branches or pull requests

3 participants