atom / watcher

Atom Filesystem Watcher

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TypeError: Cannot read property 'then' of undefined

Arcanemagus opened this issue · comments

Description

When attempting to start watcher-stress I'm getting an error that looks to be coming from atom/watcher.

Steps to Reproduce

  1. Attempt to launch watcher-stress: watcher-stress --logging-dir C:\Users\abneyl\watcher-logs --cli C:\Users\abneyl\Documents\GitHub\

Expected behavior:

No idea, it's never worked 😛.

Actual behavior:

The following stack trace is printed:

PS C:\Users\abneyl\Documents\GitHub\watcher-stress> watcher-stress --logging-dir C:\Users\abneyl\watcher-logs --cli C:\Users\abneyl\Documents\GitHub\
>> ERROR <<
TypeError: Cannot read property 'then' of undefined
    at new PathWatcher (C:\Users\abneyl\Documents\GitHub\watcher-stress\node_modules\@atom\watcher\lib\path-watcher.js:68:58)
    at PathWatcherManager.createWatcher (C:\Users\abneyl\Documents\GitHub\watcher-stress\node_modules\@atom\watcher\lib\path-watcher-manager.js:42:21)
    at Object.watchPath (C:\Users\abneyl\Documents\GitHub\watcher-stress\node_modules\@atom\watcher\lib\index.js:50:49)
    at WatcherFacade.start (C:\Users\abneyl\Documents\GitHub\watcher-stress\build\facade.js:44:29)
    at Promise.all.roots.map (C:\Users\abneyl\Documents\GitHub\watcher-stress\build\cli.js:13:19)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)

Reproduces how often:

100% of the time.

Versions

smashwilson/watcher-stress@3fe06f4
@atom/watcher@0.0.2

OS: Windows 10 x64 Enterprise
VS: VS2015
Node.js: v8.7.0
npm: v5.5.1

Additional Information

Let me know if this should be filed over on @smashwilson/watcher-stress instead!

Attempting to run watcher-stress --exercise serial --watcher-count 1000 --logging-dir C:\Users\abneyl\watcher-logs gives me:

>> SERIAL WATCHER STRESS TEST <<
starting watcher #0 on directory-17433
>> ERROR <<
TypeError: Cannot read property 'then' of undefined
    at new PathWatcher (C:\Users\abneyl\Documents\GitHub\watcher-stress\node_modules\@atom\watcher\lib\path-watcher.js:68:58)
    at PathWatcherManager.createWatcher (C:\Users\abneyl\Documents\GitHub\watcher-stress\node_modules\@atom\watcher\lib\path-watcher-manager.js:42:21)
    at Object.watchPath (C:\Users\abneyl\Documents\GitHub\watcher-stress\node_modules\@atom\watcher\lib\index.js:50:49)
    at WatcherFacade.start (C:\Users\abneyl\Documents\GitHub\watcher-stress\build\facade.js:44:29)
    at runWatcher (C:\Users\abneyl\Documents\GitHub\watcher-stress\build\serial-watchers.js:30:32)
    at module.exports (C:\Users\abneyl\Documents\GitHub\watcher-stress\build\serial-watchers.js:19:11)
    at <anonymous>

After printing that once it exits.


Attempting to run watcher-stress --exercise parallel --watcher-count 1000 --logging-dir C:\Users\abneyl\watcher-logs gives me:

>> PARALLEL WATCHER STRESS TEST <<
>> ERROR <<
TypeError: Cannot read property 'then' of undefined
    at new PathWatcher (C:\Users\abneyl\Documents\GitHub\watcher-stress\node_modules\@atom\watcher\lib\path-watcher.js:68:58)
    at PathWatcherManager.createWatcher (C:\Users\abneyl\Documents\GitHub\watcher-stress\node_modules\@atom\watcher\lib\path-watcher-manager.js:42:21)
    at Object.watchPath (C:\Users\abneyl\Documents\GitHub\watcher-stress\node_modules\@atom\watcher\lib\index.js:50:49)
    at WatcherFacade.start (C:\Users\abneyl\Documents\GitHub\watcher-stress\build\facade.js:44:29)
    at watcherStartPromises.push (C:\Users\abneyl\Documents\GitHub\watcher-stress\build\parallel-watchers.js:26:38)
    at module.exports (C:\Users\abneyl\Documents\GitHub\watcher-stress\build\parallel-watchers.js:42:7)
    at <anonymous>
(node:2852) [DEP0013] DeprecationWarning: Calling an asynchronous function without callback is deprecated.

This gets repeated (4 times before I killed it).

@Arcanemagus: 3d98729 should take care of that 😅

Uninstalling and re-installing watcher-stress should upgrade the dependency:

$ npm uninstall -g @smashwilson/watcher-stress
$ npm_config_debug="true" npm install -g @smashwilson/watcher-stress

🌈 Programming tip of the day: dependencies !== devDependencies

semver is... funky under v0.x.y.

^0.0.2 is only valid for >=0.0.2 <0.0.3, so @smashwilson/watcher-stress isn't picking up the update to @atom/watcher.

Oh yuck. I wonder why that worked for me... ?

Will >=0.0.4 pick up newer 0.* versions?

Okay, @smashwilson/watcher-stress@1.0.8 has a dependency on @atom/watcher >= 0.0.4.

When the range is 0.x.y, x is "major" and y is "minor" which is why it works that way (^ being "within this minor range").

Can confirm it's working now, thanks!

Excellent. Hopefully this'll make it easier for testers to keep up with changes upstream, too.