atom/node-pathwatcher

TypeError: Path must be a string

Opened this issue · 2 comments

Hi all,
Trying to watch 1 file on Mac OS X + io.js 2.4.0 like this:

const watcher = PathWatcher.watch('./dist/bundle.js');

and get following stack trance

fs.js:549
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^
TypeError: path must be a string
    at TypeError (native)
    at Object.fs.openSync (fs.js:549:18)
    at Object.fs.readFileSync (fs.js:397:15)
    at PathWatcher.watch (/Users/xamd/Projects/browserify-react-live/server/index.js:46:25)
    at emitTwo (events.js:87:13)
    at PathWatcher.emit (events.js:172:7)
    at HandleWatcher.<anonymous> (/Users/xamd/Projects/browserify-react-live/node_modules/pathwatcher/lib/main.js:134:28)
    at emitThree (events.js:97:13)
    at HandleWatcher.emit (events.js:175:7)
    at HandleWatcher.onEvent (/Users/xamd/Projects/browserify-react-live/node_modules/pathwatcher/lib/main.js:60:23)

suggestions?

P.S. I've tried a lot of different combinations of path to watch, nothing works

It looks like the error is coming from PathWatcher.watch (/Users/xamd/Projects/browserify-react-live/server/index.js:46:25) which means not in PathWatcher but in the position in that file which is not part of this project.

what is the option to resolve it