open-cli-tools/chokidar-cli

crash when `paths` is relative with `./` prefix (and exists...)

nmschulte opened this issue · 2 comments

paulmillr/chokidar#896

upgrade to 3.2.1 or whatever is the latest. you've pointed out that chokidar-cli doesn't use latest chokidar.

npm install chokidar@latest chokidar-cli@latest

+ chokidar-cli@2.0.0
+ chokidar@3.2.1
added 44 packages from 29 contributors and audited 81 packages in 1.513s
found 0 vulnerabilities

chokidar --version

chokidar-cli: 2.0.0
chokidar: 3.0.2

./node_modules/.bin/chokidar ./

(node:19234) UnhandledPromiseRejectionWarning: TypeError: Expected pattern to be a non-empty string
    at picomatch (/tmp/test/node_modules/picomatch/lib/picomatch.js:43:11)
    at createPattern (/tmp/test/node_modules/anymatch/index.js:27:18)
    at mtchers.map.matcher (/tmp/test/node_modules/anymatch/index.js:89:43)
    at Array.map (<anonymous>)
    at anymatch (/tmp/test/node_modules/anymatch/index.js:89:28)
    at new WatchHelper (/tmp/test/node_modules/chokidar-cli/node_modules/chokidar/index.js:155:38)
    at FSWatcher._getWatchHelpers (/tmp/test/node_modules/chokidar-cli/node_modules/chokidar/index.js:746:10)
    at NodeFsHandler._addToNodeFs (/tmp/test/node_modules/chokidar-cli/node_modules/chokidar/lib/nodefs-handler.js:518:21)
    at Promise.all.paths.map (/tmp/test/node_modules/chokidar-cli/node_modules/chokidar/index.js:406:47)
    at Array.map (<anonymous>)
    at FSWatcher.add (/tmp/test/node_modules/chokidar-cli/node_modules/chokidar/index.js:405:13)
    at Object.watch (/tmp/test/node_modules/chokidar-cli/node_modules/chokidar/index.js:900:11)
    at startWatching (/tmp/test/node_modules/chokidar-cli/index.js:138:28)
    at main (/tmp/test/node_modules/chokidar-cli/index.js:127:5)
    at Object.<anonymous> (/tmp/test/node_modules/chokidar-cli/index.js:220:1)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
(node:19234) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:19234) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

./node_modules/.bin/chokidar .

add:node_modules/.bin/chokidar
Watching "." ..

./node_modules/.bin/chokidar ../test/

add:node_modules/.bin/chokidar
Watching "../test/" ..

My real path is like ./src, but that won't work, but plainly src (no ./ prefix) will.

Does it happen with the latest master here?

./node_modules/.bin/chokidar --version

chokidar-cli: 2.1.0
chokidar: 3.2.3

./node_modules/.bin/chokidar ./

add:node_modules/.bin/chokidar
Watching "./" ..