napcs/node-livereload

watcher is undefined in close()

Closed this issue ยท 2 comments

What version are you using? (Don't say latest. Be specific.)

Latests ๐Ÿ˜„ 0.6.2.

Expected result

Call close() before watch() without an error.

Actual result

TypeError: Cannot read property 'close' of undefined

Steps to reproduce issue

It looks like watcher is set when watch() is called. But I call refresh() manually and don't use watch(). However I'd like to close the server with close(). Currently this throws, because it expects watcher to be set.

Why is this important?

I use refresh() manually and inside a webpack build and don't use watch().

napcs commented

@donaldpipowitch thanks for reporting this. 0.6.3 was released to npm.

Thank you for the fix! โ™ฅ๏ธ