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

watch is "watching" wrong files #97

Closed
theKashey opened this issue Oct 26, 2020 · 3 comments
Closed

watch is "watching" wrong files #97

theKashey opened this issue Oct 26, 2020 · 3 comments
Labels
bug Something isn't working good first issue Good for newcomers help wanted Looking for help to reproduce, debug, or open a PR

Comments

@theKashey
Copy link

Expected Behavior

watch more works

Current Behavior

Running a command

$ tsm "packages/**/*.scss" --ignore node_modules --exportType default -n none -w

generates the following output

Watching files...
[ADDED] packages/uikit/styles/_index.scss
[ADDED] packages/uikit/styles/mixin.scss
[ADDED] packages/uikit/styles/theme.scss
[NO GENERATED TYPES] packages/uikit/styles/_index.scss
[NO GENERATED TYPES] packages/uikit/styles/mixin.scss
[NO GENERATED TYPES] packages/uikit/styles/theme.scss
[ADDED] packages/uikit/styles/node_modules/.bin/acorn

^^^ note the wrong file added

After that, the process is doomed

expected "{".
  ╷
1 │ #!/usr/bin/env node
  │  ^
  ╵
  packages/uikit/styles/node_modules/.bin/acorn 1:2

Your Environment

  • Version used: 3.2.2
@theKashey
Copy link
Author

--ignoreInitial is solving the problem.
Sounds like this is more chokidar API problem, which might "see" more files than it should.
However simple re-glob-ing file in change/add callback might save the day.

@skovy
Copy link
Owner

skovy commented Oct 28, 2020

Yea, this seems like an issue with chokadir 🤔

I wonder if it's related to these issues relating to symlinks: paulmillr/chokidar#544 & paulmillr/chokidar#967

I actually didn't realize the node module .bin files are symlinks, but makes sense.

I think a stop-gap solution like you said by doing a re-check against the glob could solve the immediate issue, although unfortunate.

@skovy skovy added bug Something isn't working good first issue Good for newcomers needs help labels Oct 28, 2020
@skovy skovy added help wanted Looking for help to reproduce, debug, or open a PR and removed needs help labels Jan 25, 2022
@skovy
Copy link
Owner

skovy commented Feb 17, 2022

Closing this issue since it's stale and an issue with a dependency, not this package.

However, if this is still an issue (chokadir was updated) I wonder if using the ignore option could help? https://github.com/skovy/typed-scss-modules#--ignore

I haven't tried, but maybe something like --ignopre 'node_modules/.bin/*'?

@skovy skovy closed this as completed Feb 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Looking for help to reproduce, debug, or open a PR
Projects
None yet
Development

No branches or pull requests

2 participants