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

Emacs lock files still cause problems #74

Open
jdunnpenguin opened this issue Aug 28, 2018 · 0 comments
Open

Emacs lock files still cause problems #74

jdunnpenguin opened this issue Aug 28, 2018 · 0 comments

Comments

@jdunnpenguin
Copy link

I've seen both #40 and #24 and while editing scss files with emacs I'm using the match regex option to exclude emacs lockfiles:
node-sass-chokidar src/ -o src/ --watch --recursive --match-regex '^[^#]*$'

Since the lock files include '#' characters and my file names do not this should work and it does until I save the file. Then:

fs.js:113
    throw err;
    ^

Error: ENOENT: no such file or directory, stat '/home/jdunn/src/reactjs-ui/src/.#global.scss'
    at Object.statSync (fs.js:815:3)
    at Graph.addFile (/home/jdunn/src/reactjs-ui/node_modules/sass-graph/sass-graph.js:64:18)
    at /home/jdunn/src/reactjs-ui/node_modules/sass-graph/sass-graph.js:54:13
    at arrayEach (/home/jdunn/src/reactjs-ui/node_modules/lodash/lodash.js:516:11)
    at Function.forEach (/home/jdunn/src/reactjs-ui/node_modules/lodash/lodash.js:9342:14)
    at new Graph (/home/jdunn/src/reactjs-ui/node_modules/sass-graph/sass-graph.js:53:7)
    at Object.module.exports.parseDir (/home/jdunn/src/reactjs-ui/node_modules/sass-graph/sass-graph.js:156:17)
    at buildGraph (/home/jdunn/src/reactjs-ui/node_modules/node-sass-chokidar/bin/node-sass-chokidar:257:23)
    at FSWatcher.changeHandler (/home/jdunn/src/reactjs-ui/node_modules/node-sass-chokidar/bin/node-sass-chokidar:294:13)
    at FSWatcher.emit (events.js:182:13)

Tracing through the code the issue is that the regex filter is not applied in sass-graph.js when the Graph object is instantiated. Creating the Graph triggers a scan of the directory where the .#global.scss file is found and then a stat call throws the ENOENT exception.

Versions grepped out of npm ls:
(env) [jdunn@localhost reactjs-ui]$ npm ls | grep sass 2>/dev/null
├─┬ node-sass-chokidar@1.3.3
│ ├─┬ node-sass@4.9.3
│ │ ├── sass-graph@2.2.4 deduped
│ ├─┬ sass-graph@2.2.4

I'll turn off emacs lock files for now, but that's not a great long term solution.

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

1 participant