Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Deleting a .scss file gives watcher.deleted is not a function #2248

Closed
webfaqtory opened this issue Feb 10, 2018 · 9 comments
Closed

Deleting a .scss file gives watcher.deleted is not a function #2248

webfaqtory opened this issue Feb 10, 2018 · 9 comments

Comments

@webfaqtory
Copy link

webfaqtory commented Feb 10, 2018

Everything works fine until I delete a watched .scss file then I get

TypeError: watcher.deleted is not a function
at Gaze. (/var/www/dev/web/themes/custom/acas/node_modules/node-sass/bin/node-sass:266:21)
at emitOne (events.js:116:13)
at Gaze.emit (events.js:211:7)
at Gaze.emit (/var/www/dev/web/themes/custom/acas/node_modules/gaze/lib/gaze.js:128:32)
at /var/www/dev/web/themes/custom/acas/node_modules/gaze/lib/gaze.js:408:18
at Array.forEach ()
at /var/www/dev/web/themes/custom/acas/node_modules/gaze/lib/gaze.js:404:12
at FSReqWrap.oncomplete (fs.js:135:15)

  • NPM version (5.6.0):
  • Node version (8.9.4):
  • Node Process ({ http_parser: '2.7.0', node: '8.9.4', v8: '6.1.534.50', uv: '1.15.0', zlib: '1.2.11', ares: '1.10.1-DEV', modules: '57', nghttp2: '1.25.0', openssl: '1.0.2n', icu: '59.1', unicode: '9.0', cldr: '31.0.1', tz: '2017b' } ):
  • Node Platform (linux):
  • Node architecture (x64):
  • node-sass version ("node-sass 4.7.2 (Wrapper) [JavaScript] libsass 3.5.0.beta.2 (Sass Compiler) [C/C++] ):
  • npm node-sass versions ([email protected]):

In watcher.js there is no function called watcher.deleted but there is watcher.removed. Editing node-sass to call this instead gives 'Error: ENOENT: no such file or directory,'. Had to give up

@nschonni
Copy link
Contributor

Looks like we don't have any tests around the remove right now https://github.com/sass/node-sass/blob/master/test/watcher.js
I would have thought that removed would have been correct since that is the function in lib/watcher
@xzyfer thoughts?

@xzyfer
Copy link
Contributor

xzyfer commented Feb 20, 2018

I guess this is related to https://github.com/sass/node-sass/pull/2181/files

@CaitlinWeb
Copy link

I'm new to using node-sass but I tried the watch option and got the exact same error as OP. The error appears on the first change, which was not deleting anything. Here is the full error I get (with the filepath removed).

...node-sass\bin\node-sass:266
    handler(watcher.deleted(file));
                    ^

TypeError: watcher.deleted is not a function
    at Gaze.<anonymous> (...node-sass\bin\node-sass:266:21)
    at Gaze.emit (events.js:160:13)
    at Gaze.emit (...node-sass\node_modules\gaze\lib\gaze.js:128:32)
    at ...node-sass\node_modules\gaze\lib\gaze.js:408:18
    at Array.forEach (<anonymous>)
    at ...node-sass\node_modules\gaze\lib\gaze.js:404:12
    at FSReqWrap.oncomplete (fs.js:149:20)

I'm on Windows, and using 4.7.2 as well. Could be relevant, but I have other error warnings (not worth explaining unless you think it has to do with this error).

@kuzyo
Copy link

kuzyo commented Mar 12, 2018

Getting the same error as @CaitlinWeb. What is the best way to fix ? Thanks.

node-sass       4.7.2   (Wrapper)       [JavaScript]
libsass         3.5.0.beta.2    (Sass Compiler) [C/C++]

@xzyfer
Copy link
Contributor

xzyfer commented Mar 12, 2018

This is fixed in 4.8.1. We've temporarily unpublished it due #2280. The fix is to wait until we 4.8.2 is released.

@kuzyo
Copy link

kuzyo commented Mar 12, 2018

@xzyfer Thanks for the fast response. When do you plan to release 4.8.2 ?

@xzyfer
Copy link
Contributor

xzyfer commented Mar 12, 2018

When there is a resolution to #2280. You can subscribe to that issue for updates.

@CaitlinWeb
Copy link

CaitlinWeb commented Mar 13, 2018

After updating to 4.8.2 I haven't gotten the error yet. Seems to be fixed. Thanks!

@davismj
Copy link

davismj commented Mar 30, 2018

Same in 4.8.3

fs.js:994
  binding.lstat(pathModule._makeLong(path), statValues);
          ^

Error: ENOENT: no such file or directory, lstat 'path\to\test.scss'

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

No branches or pull requests

6 participants