Skip to content

Symlinked directories causing infinite compile loop #94

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
BenSjoberg opened this issue Jan 3, 2019 · 0 comments
Closed

Symlinked directories causing infinite compile loop #94

BenSjoberg opened this issue Jan 3, 2019 · 0 comments

Comments

@BenSjoberg
Copy link
Contributor

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: 5.1.0
  • Cross-platform modules: 5.1.1
  • Android Runtime: 5.1.1
  • iOS Runtime: 5.1.1
  • Plugin(s): none

(Additional note: I've only tried this on macOS 10.14.)

Describe the bug

This issue is related to #85 and possibly connected to #53.

As documented in #85, there seems to be an issue with how chokidar is handling symlinked directories. For some reason, the glob isn't getting applied to files under symlinks - chokidar is firing events for any file change under a symlink. For example, if b is a link to a, changing a/example.ts will cause chokidar to report that b/example.ts has been modified, even though it obviously doesn't match the .s[ac]ss glob.

If a symlinked directory contains an SCSS file, this causes an infinite loop: when the compiler rewrites the CSS file, it triggers the watcher, causing the CSS file to be rewritten again, etc. The result is that tns run is totally unusable without --bundle if you have a symlinked directory containing SCSS files in your project.

I tried updating to chokidar 2.0.4 (2.0.2 is pinned currently), but no luck. This issue was reported to the chokidar devs last June but unfortunately they haven't gotten to it yet.

Until this is fixed in chokidar itself, a simple workaround is to verify the reported file paths actually match the .s[ac]ss glob before compiling. I tested this locally and it appears to fix the problem. I'll create a PR for this shortly.

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